public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/35468]  New: LHS of assignment can be folded to a constant causing ICE
@ 2008-03-05  8:30 maddox at gcc dot gnu dot org
  2008-03-05 15:29 ` [Bug tree-optimization/35468] " rguenth at gcc dot gnu dot org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: maddox at gcc dot gnu dot org @ 2008-03-05  8:30 UTC (permalink / raw)
  To: gcc-bugs

The following testcase causes an ICE.  It is simply gcc.dg/980502-1.c
invoked with a different set of options, in particular, -fno-tree-dce.
Also included is the output of the final ccp pass.  Notice the (dead)
assignment '88 = 1'.  It looks like 'line[8]' in an lvalue context was
incorrectly folded to an rvalue.  I believe that the RTL phases choke on
this when DCE is not allowed to eliminate it.  I produced the output
below using trunk, but the issue shows up in 4.0.3 and probably elsewhere.

--- Contents of file 980502-1.c ---

char *const f(void)
{
        char *const line = "/dev/ptyXX";
        line[8] = 1;
        return line;
}

--- Failing compilation command ---

 ../rel/bin/gcc -v -save-temps  -c -O2 -fdump-tree-ccp -fno-tree-dce 980502-1.c
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc/configure --with-gmp=/home/maddox/GCCLIBS
--with-mpfr=/home/maddox/GCCLIBS --build=i686-pc-linux-gnu
--host=i686-pc-linux-gnu --target=i686-pc-linux-gnu
--prefix=/home/maddox/trunk/rel --disable-bootstrap --disable-libmudflap
--disable-libgomp --enable-checking=yes,types
Thread model: posix
gcc version 4.4.0 20080304 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-c' '-O2' '-fdump-tree-ccp'
'-fno-tree-dce' '-mtune=generic'
 /home/maddox/trunk/rel/libexec/gcc/i686-pc-linux-gnu/4.4.0/cc1 -E -quiet -v
980502-1.c -mtune=generic -fdump-tree-ccp -fno-tree-dce -O2 -fpch-preprocess -o
980502-1.i
ignoring nonexistent directory
"/home/maddox/trunk/rel/lib/gcc/i686-pc-linux-gnu/4.4.0/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /home/maddox/trunk/rel/include
 /home/maddox/trunk/rel/lib/gcc/i686-pc-linux-gnu/4.4.0/include
 /home/maddox/trunk/rel/lib/gcc/i686-pc-linux-gnu/4.4.0/include-fixed
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-c' '-O2' '-fdump-tree-ccp'
'-fno-tree-dce' '-mtune=generic'
 /home/maddox/trunk/rel/libexec/gcc/i686-pc-linux-gnu/4.4.0/cc1 -fpreprocessed
980502-1.i -quiet -dumpbase 980502-1.c -mtune=generic -auxbase 980502-1 -O2
-version -fdump-tree-ccp -fno-tree-dce -o 980502-1.s
GNU C (GCC) version 4.4.0 20080304 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 4.0.3 (Ubuntu 4.0.3-1ubuntu5), GMP version
4.2.1, MPFR version 2.2.1.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: b487bd365f366d1cb315758fb9e38dc9
980502-1.c: In function 'f':
980502-1.c:7: internal compiler error: in simplify_subreg, at
simplify-rtx.c:4936
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

--- Contents of dump file 980502-1.c.056t.ccp2 ---

;; Function f (f)

f ()
{
<bb 2>:
  88 = 1;
  return &"/dev/ptyXX"[0];

}


-- 
           Summary: LHS of assignment can be folded to a constant causing
                    ICE
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: maddox at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

end of thread, other threads:[~2010-05-22 18:22 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-05  8:30 [Bug tree-optimization/35468] New: LHS of assignment can be folded to a constant causing ICE maddox at gcc dot gnu dot org
2008-03-05 15:29 ` [Bug tree-optimization/35468] " rguenth at gcc dot gnu dot org
2008-03-05 15:29 ` rguenth at gcc dot gnu dot org
2008-03-06 10:11 ` rguenth at gcc dot gnu dot org
2008-03-06 10:34 ` rguenth at gcc dot gnu dot org
2008-03-06 10:36 ` rguenth at gcc dot gnu dot org
2008-08-11  1:02 ` pinskia at gcc dot gnu dot org
2008-08-11  1:03 ` pinskia at gcc dot gnu dot org
2008-08-11  1:04 ` [Bug tree-optimization/35468] [4.2/4.3/4.4 Regression] " pinskia at gcc dot gnu dot org
2008-08-22 14:34 ` rguenth at gcc dot gnu dot org
2008-12-08 15:09 ` rguenth at gcc dot gnu dot org
2008-12-09 14:12 ` jakub at gcc dot gnu dot org
2008-12-09 16:58 ` jakub at gcc dot gnu dot org
2008-12-09 17:12 ` [Bug tree-optimization/35468] [4.2/4.3 " jakub at gcc dot gnu dot org
2009-03-31 20:48 ` [Bug tree-optimization/35468] [4.3 " jsm28 at gcc dot gnu dot org
2009-08-04 12:45 ` rguenth at gcc dot gnu dot org
2010-05-22 18:22 ` rguenth 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).