public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/34127]  New: ICE: tree-ssa-operands.c:1688
@ 2007-11-16 21:10 rwgk at yahoo dot com
  2007-11-16 21:11 ` [Bug c/34127] " rwgk at yahoo dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: rwgk at yahoo dot com @ 2007-11-16 21:10 UTC (permalink / raw)
  To: gcc-bugs

Platform:
  Fedora release 7 (Moonshine)
  Linux idle.lbl.gov 2.6.22.9-91.fc7 #1 SMP Thu Sep 27 20:47:39 EDT 2007 x86_64
x86_64 x86_64 GNU/Linux

% g++ -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: /net/rosie/scratch2/rwgk/gcc_trunk/configure
--prefix=/net/cci-filer1/vol1/tmp/rwgk/gcc_trunk_130232_x86_64_fc7
--enable-languages=c,c++,fortran --with-mpfr=/usr
Thread model: posix
gcc version 4.3.0 20071116 (experimental) (GCC)

I'll attach a stand-alone reproducer.

It works with -O0 but not -O1 or higher:

% gcc -c -fno-strict-aliasing -O1 -Wall ice_ssa.c
ice_ssa.c: In function 's_init':
ice_ssa.c:281: internal compiler error: in get_addr_dereference_operands, at
tree-ssa-operands.c:1688
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

The reproducer is derived from: Python-2.5.1/Modules/_struct.c
It is still quite big (297 lines) but has no external
dependencies. I've spend a significant amount of time stripping
it down starting from ca. 6000 lines of pre-processed code. I hope
you can do the rest much faster than I could.

Ralf


-- 
           Summary: ICE: tree-ssa-operands.c:1688
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rwgk at yahoo dot com
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34127


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

* [Bug c/34127] ICE: tree-ssa-operands.c:1688
  2007-11-16 21:10 [Bug c/34127] New: ICE: tree-ssa-operands.c:1688 rwgk at yahoo dot com
@ 2007-11-16 21:11 ` rwgk at yahoo dot com
  2007-11-17 12:40 ` [Bug tree-optimization/34127] " rguenth at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rwgk at yahoo dot com @ 2007-11-16 21:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rwgk at yahoo dot com  2007-11-16 21:11 -------
Created an attachment (id=14568)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14568&action=view)
reproducer


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34127


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

* [Bug tree-optimization/34127] ICE: tree-ssa-operands.c:1688
  2007-11-16 21:10 [Bug c/34127] New: ICE: tree-ssa-operands.c:1688 rwgk at yahoo dot com
  2007-11-16 21:11 ` [Bug c/34127] " rwgk at yahoo dot com
@ 2007-11-17 12:40 ` rguenth at gcc dot gnu dot org
  2007-11-18  2:54 ` rwgk at yahoo dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-11-17 12:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2007-11-17 12:40 -------
Works for me, this is a dup of PR34113.

*** This bug has been marked as a duplicate of 34113 ***


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34127


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

* [Bug tree-optimization/34127] ICE: tree-ssa-operands.c:1688
  2007-11-16 21:10 [Bug c/34127] New: ICE: tree-ssa-operands.c:1688 rwgk at yahoo dot com
  2007-11-16 21:11 ` [Bug c/34127] " rwgk at yahoo dot com
  2007-11-17 12:40 ` [Bug tree-optimization/34127] " rguenth at gcc dot gnu dot org
@ 2007-11-18  2:54 ` rwgk at yahoo dot com
  2007-11-18 12:50 ` [Bug tree-optimization/34127] [4.3 Regression] " rguenth at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rwgk at yahoo dot com @ 2007-11-18  2:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rwgk at yahoo dot com  2007-11-18 02:54 -------
(In reply to comment #2)
> Works for me, this is a dup of PR34113.
> 
> *** This bug has been marked as a duplicate of 34113 ***
> 

This is not the case. My original bug report was based on svn revision
130232, which includes the fix for PR34113 (fixed with svn revision
130223).

I tried again today from scratch with svn revision 130261 (this time
under Fedora 5 because the other machine crashed):

% gcc -fPIC -c -O3 ice_ssa_34127.c
ice_ssa_34127.c: In function 'prepare_s':
ice_ssa_34127.c:297: internal compiler error: in get_addr_dereference_operands,
at tree-ssa-operands.c:1688
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


-- 

rwgk at yahoo dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34127


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

* [Bug tree-optimization/34127] [4.3 Regression] ICE: tree-ssa-operands.c:1688
  2007-11-16 21:10 [Bug c/34127] New: ICE: tree-ssa-operands.c:1688 rwgk at yahoo dot com
                   ` (2 preceding siblings ...)
  2007-11-18  2:54 ` rwgk at yahoo dot com
@ 2007-11-18 12:50 ` rguenth at gcc dot gnu dot org
  2007-11-18 13:06 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-11-18 12:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2007-11-18 12:50 -------
Whoops, sorry.  Reduced testcase:

static void 
whichtable(char **pfmt)
{
  --*pfmt;
}
void prepare_s(const char *fmt)
{
  whichtable((char **)&fmt);
}

./cc1 -quiet -O t2.i
t2.i: In function 'prepare_s':
t2.i:7: internal compiler error: in get_addr_dereference_operands, at
tree-ssa-operands.c:1688
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-11-18 12:50:24
               date|                            |
            Summary|ICE: tree-ssa-              |[4.3 Regression] ICE: tree-
                   |operands.c:1688             |ssa-operands.c:1688
   Target Milestone|---                         |4.3.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34127


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

* [Bug tree-optimization/34127] [4.3 Regression] ICE: tree-ssa-operands.c:1688
  2007-11-16 21:10 [Bug c/34127] New: ICE: tree-ssa-operands.c:1688 rwgk at yahoo dot com
                   ` (3 preceding siblings ...)
  2007-11-18 12:50 ` [Bug tree-optimization/34127] [4.3 Regression] " rguenth at gcc dot gnu dot org
@ 2007-11-18 13:06 ` rguenth at gcc dot gnu dot org
  2007-11-18 13:53 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-11-18 13:06 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-11-18 12:50:24         |2007-11-18 13:06:48
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34127


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

* [Bug tree-optimization/34127] [4.3 Regression] ICE: tree-ssa-operands.c:1688
  2007-11-16 21:10 [Bug c/34127] New: ICE: tree-ssa-operands.c:1688 rwgk at yahoo dot com
                   ` (4 preceding siblings ...)
  2007-11-18 13:06 ` rguenth at gcc dot gnu dot org
@ 2007-11-18 13:53 ` rguenth at gcc dot gnu dot org
  2007-11-18 15:50 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-11-18 13:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenth at gcc dot gnu dot org  2007-11-18 13:53 -------
Hm, this is an unlucky case because of the way fold_stmt works.  What we have
is
(even more simplified):

void prepare_s(const char *fmt)
{
  char ** f = (char **)&fmt;
  *f = 0;
}

where it is not hard to see that for the store we can substitute

  fmt = 0;

as a char * rhs can be trivially converted to a const char * lhs.

Now what happens is that forwprop decides for this reason that a
propagation of (char **)&fmt is worthwhile and asks fold_stmt_in_place
to fold

  *(char **)&fmt = 0;

now the path goes through maybe_fold_stmt_indirect which only strips
same-type conversions (STRIP_TYPE_NOPS) and so fails to dispatch to
maybe_fold_offset_to_reference.  Now, if we strip the conversion in
forwprop already then in turn maybe_fold_offset_to_reference fails to
do the conversion because it (even while it would strip all conversions)
asks if the conversion from const char * to char * is useless (which
it is not) and refuses to do the trivial folding.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34127


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

* [Bug tree-optimization/34127] [4.3 Regression] ICE: tree-ssa-operands.c:1688
  2007-11-16 21:10 [Bug c/34127] New: ICE: tree-ssa-operands.c:1688 rwgk at yahoo dot com
                   ` (6 preceding siblings ...)
  2007-11-18 15:50 ` rguenth at gcc dot gnu dot org
@ 2007-11-18 15:50 ` rguenth at gcc dot gnu dot org
  2007-11-19  4:04 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-11-18 15:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from rguenth at gcc dot gnu dot org  2007-11-18 15:50 -------
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |33604, 34113
              nThis|                            |
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34127


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

* [Bug tree-optimization/34127] [4.3 Regression] ICE: tree-ssa-operands.c:1688
  2007-11-16 21:10 [Bug c/34127] New: ICE: tree-ssa-operands.c:1688 rwgk at yahoo dot com
                   ` (5 preceding siblings ...)
  2007-11-18 13:53 ` rguenth at gcc dot gnu dot org
@ 2007-11-18 15:50 ` rguenth at gcc dot gnu dot org
  2007-11-18 15:50 ` rguenth at gcc dot gnu dot org
  2007-11-19  4:04 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-11-18 15:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from rguenth at gcc dot gnu dot org  2007-11-18 15:50 -------
Subject: Bug 34127

Author: rguenth
Date: Sun Nov 18 15:49:57 2007
New Revision: 130269

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130269
Log:
2007-11-18  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/34127
        * tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_vars):
        Make code match up the comments, require compatibility of the
        pointed-to types.

        * gcc.c-torture/compile/pr34127.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr34127.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-forwprop.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34127


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

* [Bug tree-optimization/34127] [4.3 Regression] ICE: tree-ssa-operands.c:1688
  2007-11-16 21:10 [Bug c/34127] New: ICE: tree-ssa-operands.c:1688 rwgk at yahoo dot com
                   ` (7 preceding siblings ...)
  2007-11-18 15:50 ` rguenth at gcc dot gnu dot org
@ 2007-11-19  4:04 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-11-19  4:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pinskia at gcc dot gnu dot org  2007-11-19 04:04 -------
*** Bug 34122 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tbm at cyrius dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34127


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

end of thread, other threads:[~2007-11-19  4:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-16 21:10 [Bug c/34127] New: ICE: tree-ssa-operands.c:1688 rwgk at yahoo dot com
2007-11-16 21:11 ` [Bug c/34127] " rwgk at yahoo dot com
2007-11-17 12:40 ` [Bug tree-optimization/34127] " rguenth at gcc dot gnu dot org
2007-11-18  2:54 ` rwgk at yahoo dot com
2007-11-18 12:50 ` [Bug tree-optimization/34127] [4.3 Regression] " rguenth at gcc dot gnu dot org
2007-11-18 13:06 ` rguenth at gcc dot gnu dot org
2007-11-18 13:53 ` rguenth at gcc dot gnu dot org
2007-11-18 15:50 ` rguenth at gcc dot gnu dot org
2007-11-18 15:50 ` rguenth at gcc dot gnu dot org
2007-11-19  4:04 ` pinskia at gcc dot gnu dot 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).