public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/19743] New: internal compiler error on errneous code
@ 2005-02-01 18:05 heikki dot orsila at iki dot fi
  2005-02-01 18:19 ` [Bug middle-end/19743] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: heikki dot orsila at iki dot fi @ 2005-02-01 18:05 UTC (permalink / raw)
  To: gcc-bugs

Following invalid C function gives internal compiler error on x86_64, but not on
x86, on GCC 3.4.3 and 3.3.5:

char blabla(unsigned int a)
{
  return &((unsigned char *) &a)[0];
}

3.3.5 gives:

$ ./gcc -Wall -O2 -c /test/char.c
/test/char.c: In function `blabla':
/test/char.c:3: warning: return makes integer from pointer without a cast
/test/char.c:4: error: unrecognizable insn:
(insn 29 11 13 0 (nil) (set (reg:SI 0 eax [62])
        (subreg:SI (plus:DI (subreg:DI (reg:QI 7 spl) 0)
                (const_int -4 [0xfffffffffffffffc])) 0)) -1 (nil)
    (nil))
/test/char.c:4: internal compiler error: in extract_insn, at recog.c:2175

$ ./gcc -v
Reading specs from /build/gcc/lib/gcc-lib/x86_64-unknown-linux-gnu/3.3.5/specs
Configured with: ./configure --enable-languages=c --prefix=/build/gcc
Thread model: posix
gcc version 3.3.5


3.4.3 gives:

$ ./gcc -Wall -O2 -c /test/char.c
/test/char.c: In function `blabla':
/test/char.c:3: warning: return makes integer from pointer without a cast
/test/char.c:4: error: unrecognizable insn:
(insn 30 11 13 0 (set (reg:SI 0 ax [62])
        (subreg:SI (plus:DI (subreg:DI (reg:QI 7 sp) 0)
                (const_int -4 [0xfffffffffffffffc])) 0)) -1 (nil)
    (nil))
/test/char.c:4: internal compiler error: in extract_insn, at recog.c:2083

$ ./gcc -v
Reading specs from /build/gcc/lib/gcc/x86_64-unknown-linux-gnu/3.4.3/specs
Configured with: ./configure --enable-languages=c --prefix=/build/gcc
Thread model: posix
gcc version 3.4.3

-- 
           Summary: internal compiler error on errneous code
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: heikki dot orsila at iki dot fi
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug middle-end/19743] internal compiler error on errneous code
  2005-02-01 18:05 [Bug c/19743] New: internal compiler error on errneous code heikki dot orsila at iki dot fi
@ 2005-02-01 18:19 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-01 18:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-01 18:19 -------
The code is undefined but still valid, well really it is invalid if you don't have a cast.
This is all fixed on the mainline for 4.0.0 anyways and since this is not a regression closing as fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
          Component|c                           |middle-end
           Keywords|                            |ice-on-valid-code
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.0


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


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

end of thread, other threads:[~2005-02-01 18:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-01 18:05 [Bug c/19743] New: internal compiler error on errneous code heikki dot orsila at iki dot fi
2005-02-01 18:19 ` [Bug middle-end/19743] " 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).