[Bug 1642109] Re: internal compiler error: in expand_debug_locations, at cfgexpand.c:5118

Bug Watch Updater 1642109 at bugs.launchpad.net
Sun Jul 1 14:54:41 UTC 2018


Launchpad has imported 12 comments from the remote bug at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78643.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2016-12-02T11:30:42+00:00 Doko-v wrote:

Created attachment 40223
test case

seen on trunk, 6 and 5 branches on x86_64-linux-gnu, works with -O1 and
up:

$ g++ -c -O0 main.cpp
main.cpp: In function 'void p(AV)':
main.cpp:80:6: note: The ABI for passing parameters with 32-byte alignment has changed in GCC 4.6
 void p(union AV a) {
      ^
main.cpp: In function 'void test(AV, int)':
main.cpp:101:29: internal compiler error: in convert_move, at expr.c:230
     r.av = _mm256_shift_left(a.av,n);
            ~~~~~~~~~~~~~~~~~^~~~~~~~
0x898da0 convert_move(rtx_def*, rtx_def*, int)
        ../../src/gcc/expr.c:230
0x89f5cb store_expr_with_bounds(tree_node*, rtx_def*, int, bool, bool, tree_node*)
        ../../src/gcc/expr.c:5628
0x89fa3e expand_assignment(tree_node*, tree_node*, bool)
        ../../src/gcc/expr.c:5320
0x7b3dcd expand_gimple_stmt_1
        ../../src/gcc/cfgexpand.c:3641
0x7b3dcd expand_gimple_stmt
        ../../src/gcc/cfgexpand.c:3737
0x7b538f expand_gimple_basic_block
        ../../src/gcc/cfgexpand.c:5744
0x7ba596 execute
        ../../src/gcc/cfgexpand.c:6358
Please submit a full bug report,
with preprocessed source if appropriate.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1642109/comments/3

------------------------------------------------------------------------
On 2017-08-09T13:47:16+00:00 Marxin-m wrote:

Confirmed, started with
r220609.https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78643#

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1642109/comments/5

------------------------------------------------------------------------
On 2017-08-30T00:09:51+00:00 Jakub-gcc wrote:

I think the problem is that while TYPE_MODE has the hacks for vector types (vector_type_mode call), DECL_MODE doesn't have something similar.
We have some hacks for this here and there.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1642109/comments/6

------------------------------------------------------------------------
On 2017-08-30T00:33:18+00:00 Jakub-gcc wrote:

E.g. the following untested patch fixes it (or we could do it in the callers):
--- gcc/expr.c.jj	2017-08-29 19:03:09.000000000 +0200
+++ gcc/expr.c	2017-08-30 02:09:33.150618229 +0200
@@ -7010,7 +7010,11 @@ get_inner_reference (tree exp, HOST_WIDE
 	     size.  */
 	mode = TYPE_MODE (DECL_BIT_FIELD_TYPE (field));
       else if (!DECL_BIT_FIELD (field))
-	mode = DECL_MODE (field);
+	{
+	  mode = DECL_MODE (field);
+	  if (mode == BLKmode && VECTOR_TYPE_P (TREE_TYPE (exp)))
+	    mode = TYPE_MODE (TREE_TYPE (exp));
+	}
       else if (DECL_MODE (field) == BLKmode)
 	blkmode_bitfield = true;

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1642109/comments/7

------------------------------------------------------------------------
On 2017-10-10T13:25:58+00:00 Jakub-gcc wrote:

GCC 5 branch is being closed

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1642109/comments/8

------------------------------------------------------------------------
On 2017-12-01T10:48:14+00:00 Jakub-gcc wrote:

Created attachment 42764
gcc8-pr80583.patch

Untested fix.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1642109/comments/9

------------------------------------------------------------------------
On 2017-12-02T07:55:19+00:00 Jakub-gcc wrote:

Author: jakub
Date: Sat Dec  2 07:54:47 2017
New Revision: 255353

URL: https://gcc.gnu.org/viewcvs?rev=255353&root=gcc&view=rev
Log:
	PR target/78643
	PR target/80583
	* expr.c (get_inner_reference): If DECL_MODE of a non-bitfield
	is BLKmode for vector field with vector raw mode, use TYPE_MODE
	instead of DECL_MODE.

        * gcc.target/i386/pr80583.c: New test.

Added:
    trunk/gcc/testsuite/gcc.target/i386/pr80583.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/expr.c
    trunk/gcc/testsuite/ChangeLog

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1642109/comments/10

------------------------------------------------------------------------
On 2017-12-02T08:01:42+00:00 Jakub-gcc wrote:

Fixed on the trunk so far.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1642109/comments/11

------------------------------------------------------------------------
On 2017-12-15T22:09:39+00:00 Jakub-gcc wrote:

Author: jakub
Date: Fri Dec 15 22:09:07 2017
New Revision: 255721

URL: https://gcc.gnu.org/viewcvs?rev=255721&root=gcc&view=rev
Log:
	Backported from mainline
	2017-12-02  Jakub Jelinek  <jakub at redhat.com>

	PR target/78643
	PR target/80583
	* expr.c (get_inner_reference): If DECL_MODE of a non-bitfield
	is BLKmode for vector field with vector raw mode, use TYPE_MODE
	instead of DECL_MODE.

        * gcc.target/i386/pr80583.c: New test.

Added:
    branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr80583.c
Modified:
    branches/gcc-7-branch/gcc/ChangeLog
    branches/gcc-7-branch/gcc/expr.c
    branches/gcc-7-branch/gcc/testsuite/ChangeLog

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1642109/comments/12

------------------------------------------------------------------------
On 2017-12-16T08:58:06+00:00 Jakub-gcc wrote:

Fixed for 7.3+ too.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1642109/comments/13

------------------------------------------------------------------------
On 2018-06-25T16:57:46+00:00 Jakub-gcc wrote:

Author: jakub
Date: Mon Jun 25 16:57:13 2018
New Revision: 262041

URL: https://gcc.gnu.org/viewcvs?rev=262041&root=gcc&view=rev
Log:
	Backported from mainline
	2017-12-02  Jakub Jelinek  <jakub at redhat.com>

	PR target/78643
	PR target/80583
	* expr.c (get_inner_reference): If DECL_MODE of a non-bitfield
	is BLKmode for vector field with vector raw mode, use TYPE_MODE
	instead of DECL_MODE.

        * gcc.target/i386/pr80583.c: New test.

Added:
    branches/gcc-6-branch/gcc/testsuite/gcc.target/i386/pr80583.c
Modified:
    branches/gcc-6-branch/gcc/ChangeLog
    branches/gcc-6-branch/gcc/expr.c
    branches/gcc-6-branch/gcc/testsuite/ChangeLog

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1642109/comments/14

------------------------------------------------------------------------
On 2018-06-25T18:02:48+00:00 Jakub-gcc wrote:

Fixed for 6.5.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1642109/comments/15


** Changed in: gcc
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-5 in Ubuntu.
https://bugs.launchpad.net/bugs/1642109

Title:
  internal compiler error: in expand_debug_locations, at
  cfgexpand.c:5118

Status in gcc:
  Fix Released
Status in gcc-5 package in Ubuntu:
  Incomplete

Bug description:
  Hi,
  I'm getting subject error when compiling attached code with options

  g++ -finline-functions -m64 -O3 -c -g -MMD -MP -MF "main.o.d" -o
  main.o main.cpp

  Using:  gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
  System: Ubuntu 16.04

  The error asked me to "Please submit a full bug report,"

  This is a cut down example from a larger program. I'm compiling larger
  program with -m64 and have SIMD routines for SSE, AVX & AVX2

  The problem goes away if I
  1. Remove -O option or,
  2. Remove the -g option (but I do want both of these for profiling) or,
  3. Add explicit inline to
      inline __attribute__ ((target ("avx2"))) __m256i _mm256_shift_left(__m256i a, int n) and
      inline __attribute__ ((target ("avx2"))) __m256i _mm256_shift_right(__m256i a, int n)

  I love gcc and was so happy when I found __attribute__ ((target
  ("avx2"))) option. Keep up the good work.

  Thanks, Colin
  PS. The routines __m256i _mm256_shift_[left|right](__m256i a, int n) are used in initialisation preceding a large loop and performance doesn't really matter. I'm sure they can be done better.

To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc/+bug/1642109/+subscriptions



More information about the foundations-bugs mailing list