public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/67966] New: [6 regression] ICE in convert_move, at expr.c:282
@ 2015-10-14 16:54 schwab@linux-m68k.org
  2015-10-15  9:45 ` [Bug middle-end/67966] " rguenth at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: schwab@linux-m68k.org @ 2015-10-14 16:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67966

            Bug ID: 67966
           Summary: [6 regression] ICE in convert_move, at expr.c:282
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Keywords: build, ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: schwab@linux-m68k.org
                CC: hubicka at gcc dot gnu.org
  Target Milestone: ---
            Target: ia64-*-*

This was broken by r228586.

../prev-gcc/xgcc -B../prev-gcc/ -B/usr/ia64-suse-linux/bin/
-B/usr/ia64-suse-linux/bin/ -B/usr/ia64-suse-linux/lib/ -isystem
/usr/ia64-suse-linux/include -isystem /usr/ia64-suse-linux/sys-include    -c -g
-O2 -gtoggle  -gnatpg -gnata -W -Wall -nostdinc -I- -I. -Iada/generated -Iada
-I../../gcc/ada -I../../gcc/ada/gcc-interface ../../gcc/ada/eval_fat.adb -o
ada/eval_fat.o
+===========================GNAT BUG DETECTED==============================+   
| 6.0.0 20151014 (experimental) (ia64-suse-linux) GCC error:               |
| in convert_move, at expr.c:282                                           |
| Error detected around ../../gcc/ada/eval_fat.adb:191:21                  |


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/67966] [6 regression] ICE in convert_move, at expr.c:282
  2015-10-14 16:54 [Bug middle-end/67966] New: [6 regression] ICE in convert_move, at expr.c:282 schwab@linux-m68k.org
@ 2015-10-15  9:45 ` rguenth at gcc dot gnu.org
  2015-10-15 13:29 ` ebotcazou at gcc dot gnu.org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-10-15  9:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67966

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |6.0

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I assume not fixed by

2015-10-13  Alexandre Oliva <aoliva@redhat.com>

        PR middle-end/67912
        * expmed.c (store_bit_field_1): Adjust mode of BLKmode inputs.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/67966] [6 regression] ICE in convert_move, at expr.c:282
  2015-10-14 16:54 [Bug middle-end/67966] New: [6 regression] ICE in convert_move, at expr.c:282 schwab@linux-m68k.org
  2015-10-15  9:45 ` [Bug middle-end/67966] " rguenth at gcc dot gnu.org
@ 2015-10-15 13:29 ` ebotcazou at gcc dot gnu.org
  2015-10-15 13:37 ` ebotcazou at gcc dot gnu.org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2015-10-15 13:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67966

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-10-15
                 CC|                            |ebotcazou at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
No, not fixed by Alexandre's patch.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/67966] [6 regression] ICE in convert_move, at expr.c:282
  2015-10-14 16:54 [Bug middle-end/67966] New: [6 regression] ICE in convert_move, at expr.c:282 schwab@linux-m68k.org
  2015-10-15  9:45 ` [Bug middle-end/67966] " rguenth at gcc dot gnu.org
  2015-10-15 13:29 ` ebotcazou at gcc dot gnu.org
@ 2015-10-15 13:37 ` ebotcazou at gcc dot gnu.org
  2015-10-15 15:20 ` ebotcazou at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2015-10-15 13:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67966

--- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
It's again a move between a BLKmode RHS and a DImode LHS.  Frankly, I don't
understand why this is now allowed to reach the RTL expander, we will probably
need to add conversions on quite a number of paths instead of having a single
treatment in the VIEW_CONVERT_EXPR case...


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/67966] [6 regression] ICE in convert_move, at expr.c:282
  2015-10-14 16:54 [Bug middle-end/67966] New: [6 regression] ICE in convert_move, at expr.c:282 schwab@linux-m68k.org
                   ` (2 preceding siblings ...)
  2015-10-15 13:37 ` ebotcazou at gcc dot gnu.org
@ 2015-10-15 15:20 ` ebotcazou at gcc dot gnu.org
  2015-10-15 22:46 ` ebotcazou at gcc dot gnu.org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2015-10-15 15:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67966

--- Comment #4 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Our internal x86 tester finally recovered from the r288586 build breakage and
reports another failure mode, namely an ICE in store_field, at expr.c:6690.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/67966] [6 regression] ICE in convert_move, at expr.c:282
  2015-10-14 16:54 [Bug middle-end/67966] New: [6 regression] ICE in convert_move, at expr.c:282 schwab@linux-m68k.org
                   ` (3 preceding siblings ...)
  2015-10-15 15:20 ` ebotcazou at gcc dot gnu.org
@ 2015-10-15 22:46 ` ebotcazou at gcc dot gnu.org
  2015-10-16  3:45 ` hubicka at ucw dot cz
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2015-10-15 22:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67966

--- Comment #5 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
The x86-64 tester also recovered and reports the same failures as the x86 one,
plus a few failures similar to this one on IA-64.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/67966] [6 regression] ICE in convert_move, at expr.c:282
  2015-10-14 16:54 [Bug middle-end/67966] New: [6 regression] ICE in convert_move, at expr.c:282 schwab@linux-m68k.org
                   ` (4 preceding siblings ...)
  2015-10-15 22:46 ` ebotcazou at gcc dot gnu.org
@ 2015-10-16  3:45 ` hubicka at ucw dot cz
  2015-10-16  5:12 ` hubicka at gcc dot gnu.org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: hubicka at ucw dot cz @ 2015-10-16  3:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67966

--- Comment #6 from Jan Hubicka <hubicka at ucw dot cz> ---
> It's again a move between a BLKmode RHS and a DImode LHS.  Frankly, I don't
> understand why this is now allowed to reach the RTL expander, we will probably
> need to add conversions on quite a number of paths instead of having a single
> treatment in the VIEW_CONVERT_EXPR case...

This was a outcome of dicussion of the patch:
https://gcc.gnu.org/ml/gcc-patches/2015-09/msg02392.html

I believe the general idea is that modes should not be part of GIMPLE's type
system
and things will work bit smoother if we do not produce VIEW_CONVERT_EXPRs for
these.
Originally the code also skipped TYPE_MODE checking for aggregates only, but it
checked TYPE_CANONICAL which, at least in a way built by Ada, seems to be never
same for two types of different modes.

Either we commit to this decision and add conversions to the paths as needed
(indeed it seems like there will be quite few) or we can decide that mode
should match.  This should be accomplished by the patch attached which permits
only conversions from incomplete types (where mode ought to be VOIDmode).

This patch bootstraps/regtested ppc64-linux.

Going either way is not going to block my original desire to fix LTO's type
based alias analysis for cross-language cases.  Here I needed to make
TYPE_CANONICAL to match for cases where are not useless_type_conversion, thus
the motivation to get rid of this use of TYPE_CANONICAL and make it agan TBAA
specific.

In this respect I would grealy apprechiate help with adding Ada testcases.
The testcases I added for Fortran basically iterate through list of types
that should be compatible with C variants and checks that TBAA works and that
no surprious warnings are output.
See testsuite/gfortran.dg/lto/bind_c-*

Because I do not understand Ada much, I would really apprechiate if you
or someone at Adacore could prepare Ada variants of these testcases.

Note that I am not done with Fortran and C standards yet - we have at
least two deviations still.  C standard state that order of fields in union
does not matter and Fortran has character type that apparently forces
compatibility between array and scalar char.  I am not sure if the second
can be done reliably (because proably there are ABIs out there that require 
char and array of char of size 1 to be passed differently). Perhaps this
can be handled as a defect in the standard.

There is also case where global variable of Fortran variant of size_t (which
is signed) will produce warning when matched by size_t declared variable.
I have a patch for this but I am looking for cleaner solution.

Index: gimple-expr.c
===================================================================
--- gimple-expr.c       (revision 228851)
+++ gimple-expr.c       (working copy)
@@ -88,9 +88,12 @@ useless_type_conversion_p (tree outer_ty
     return true;

   /* Changes in machine mode are never useless conversions unless we
-     deal with aggregate types in which case we defer to later checks.  */
+     deal with aggregate types in which case we defer to later checks.
+     For Aggregates we allow casts to incomplete types that always have
+     VOIDmode.  */
   if (TYPE_MODE (inner_type) != TYPE_MODE (outer_type)
-      && !AGGREGATE_TYPE_P (inner_type))
+      && (!AGGREGATE_TYPE_P (inner_type)
+         || COMPLETE_TYPE_P (outer_type)))
     return false;

   /* If both the inner and outer types are integral types, then the


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/67966] [6 regression] ICE in convert_move, at expr.c:282
  2015-10-14 16:54 [Bug middle-end/67966] New: [6 regression] ICE in convert_move, at expr.c:282 schwab@linux-m68k.org
                   ` (5 preceding siblings ...)
  2015-10-16  3:45 ` hubicka at ucw dot cz
@ 2015-10-16  5:12 ` hubicka at gcc dot gnu.org
  2015-10-16 12:45 ` schwab@linux-m68k.org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: hubicka at gcc dot gnu.org @ 2015-10-16  5:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67966

--- Comment #7 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Eric,
can you, please, send me info how to reproduce the x86/x86_64 ICEs?

Honza


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/67966] [6 regression] ICE in convert_move, at expr.c:282
  2015-10-14 16:54 [Bug middle-end/67966] New: [6 regression] ICE in convert_move, at expr.c:282 schwab@linux-m68k.org
                   ` (6 preceding siblings ...)
  2015-10-16  5:12 ` hubicka at gcc dot gnu.org
@ 2015-10-16 12:45 ` schwab@linux-m68k.org
  2015-10-16 15:57 ` ebotcazou at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: schwab@linux-m68k.org @ 2015-10-16 12:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67966

--- Comment #8 from Andreas Schwab <schwab@linux-m68k.org> ---
The patch in #c6 survives bootstrap.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/67966] [6 regression] ICE in convert_move, at expr.c:282
  2015-10-14 16:54 [Bug middle-end/67966] New: [6 regression] ICE in convert_move, at expr.c:282 schwab@linux-m68k.org
                   ` (7 preceding siblings ...)
  2015-10-16 12:45 ` schwab@linux-m68k.org
@ 2015-10-16 15:57 ` ebotcazou at gcc dot gnu.org
  2015-10-20 11:08 ` dominiq at lps dot ens.fr
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2015-10-16 15:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67966

--- Comment #9 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Author: ebotcazou
Date: Fri Oct 16 15:56:49 2015
New Revision: 228917

URL: https://gcc.gnu.org/viewcvs?rev=228917&root=gcc&view=rev
Log:
        PR middle-end/67966
        * gnat.dg/pack21.adb: New test.
        * gnat.dg/pack22.adb: Likewise.
        * gnat.dg/pack22_pkg.ad[sb]: New helper.

Added:
    trunk/gcc/testsuite/gnat.dg/pack21.adb
    trunk/gcc/testsuite/gnat.dg/pack22.adb
    trunk/gcc/testsuite/gnat.dg/pack22_pkg.adb
    trunk/gcc/testsuite/gnat.dg/pack22_pkg.ads
Modified:
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/67966] [6 regression] ICE in convert_move, at expr.c:282
  2015-10-14 16:54 [Bug middle-end/67966] New: [6 regression] ICE in convert_move, at expr.c:282 schwab@linux-m68k.org
                   ` (8 preceding siblings ...)
  2015-10-16 15:57 ` ebotcazou at gcc dot gnu.org
@ 2015-10-20 11:08 ` dominiq at lps dot ens.fr
  2015-10-21 18:01 ` hubicka at gcc dot gnu.org
  2015-10-21 22:26 ` ebotcazou at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-10-20 11:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67966

--- Comment #10 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Revision r228586 also caused

FAIL: g++.dg/opt/flifetime-dse2.C  -std=gnu* execution test

on x86_64-apple-darwin14 with both -m32 and -m64.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/67966] [6 regression] ICE in convert_move, at expr.c:282
  2015-10-14 16:54 [Bug middle-end/67966] New: [6 regression] ICE in convert_move, at expr.c:282 schwab@linux-m68k.org
                   ` (9 preceding siblings ...)
  2015-10-20 11:08 ` dominiq at lps dot ens.fr
@ 2015-10-21 18:01 ` hubicka at gcc dot gnu.org
  2015-10-21 22:26 ` ebotcazou at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: hubicka at gcc dot gnu.org @ 2015-10-21 18:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67966

--- Comment #11 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Author: hubicka
Date: Wed Oct 21 18:00:30 2015
New Revision: 229132

URL: https://gcc.gnu.org/viewcvs?rev=229132&root=gcc&view=rev
Log:

        PR middle-end/67966
        * tree.c (verify_type): Verify that TYPE_MODE match
        between TYPE_CANONICAL and type.
        * expr.c (store_expr_with_bounds): Revert my previous change.
        * expmed.c (store_bit_field_1): Revert prevoius change.
        * gimple-expr.c (useless_type_conversion_p): Require TYPE_MODE
        to match for all types.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/expmed.c
    trunk/gcc/expr.c
    trunk/gcc/gimple-expr.c
    trunk/gcc/tree.c


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug middle-end/67966] [6 regression] ICE in convert_move, at expr.c:282
  2015-10-14 16:54 [Bug middle-end/67966] New: [6 regression] ICE in convert_move, at expr.c:282 schwab@linux-m68k.org
                   ` (10 preceding siblings ...)
  2015-10-21 18:01 ` hubicka at gcc dot gnu.org
@ 2015-10-21 22:26 ` ebotcazou at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2015-10-21 22:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67966

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #12 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Fixed by Jan's patch.


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-10-21 22:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-14 16:54 [Bug middle-end/67966] New: [6 regression] ICE in convert_move, at expr.c:282 schwab@linux-m68k.org
2015-10-15  9:45 ` [Bug middle-end/67966] " rguenth at gcc dot gnu.org
2015-10-15 13:29 ` ebotcazou at gcc dot gnu.org
2015-10-15 13:37 ` ebotcazou at gcc dot gnu.org
2015-10-15 15:20 ` ebotcazou at gcc dot gnu.org
2015-10-15 22:46 ` ebotcazou at gcc dot gnu.org
2015-10-16  3:45 ` hubicka at ucw dot cz
2015-10-16  5:12 ` hubicka at gcc dot gnu.org
2015-10-16 12:45 ` schwab@linux-m68k.org
2015-10-16 15:57 ` ebotcazou at gcc dot gnu.org
2015-10-20 11:08 ` dominiq at lps dot ens.fr
2015-10-21 18:01 ` hubicka at gcc dot gnu.org
2015-10-21 22:26 ` ebotcazou at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).