public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/22599] New: Segfault with invalid asm usage
@ 2005-07-21 20:14 schodet at efrei dot fr
  2005-07-21 20:33 ` [Bug target/22599] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: schodet at efrei dot fr @ 2005-07-21 20:14 UTC (permalink / raw)
  To: gcc-bugs

I triggered a segfault on a i386 target with a piece of code intented to be
compiled for avr target. I get a more descriptive message by modifiying the code
a little bit. Here is the source, messages and versions :

typedef unsigned long uint32_t;
typedef unsigned char uint8_t;

int
main (void)
{
    volatile uint32_t d = 0;
    volatile uint8_t b0 = 1, b1 = 2, b2 = 3, b3 = 4;
    asm ("mov %C0, %3"  "\r\n"
         "mov %D0, %4"  "\r\n"
         : "=d" (d) : "r" (b0), "r" (b1), "r" (b2), "r" (b3));
    return 0;
}

/*
cc -g -Wall -W -Wundef -O2  -I../../.. -I../../../common -MMD -include
avrconfig.h   t.c   -o t
t.c: In function `main':
t.c:13: internal compiler error: Segmentation fault
*/

/* Or with a modified version :

typedef unsigned long uint32_t;
typedef unsigned char uint8_t;

int
main (void)
{
    volatile uint32_t d = 0;
    volatile uint8_t b0 = 1, b1 = 2, b2 = 3, b3 = 4;
    asm ("mov %D0, %4"  "\r\n"
         : "=d" (d) : "r" (b0), "r" (b1), "r" (b2), "r" (b3));
    return 0;
}
*/

/*
t.c:15: internal compiler error: in print_operand, at config/i386/i386.c:7003
*/

/* gcc -v
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.5/specs
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared
--enable-__cxa_atexit --with-system-zlib --enable-nls --without-included-gettext
--enable-clocale=gnu --enable-debug --enable-java-gc=boehm
--enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.5 (Debian 1:3.3.5-13)
*/

-- 
           Summary: Segfault with invalid asm usage
           Product: gcc
           Version: 3.3.5
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: schodet at efrei dot fr
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i486-linux
  GCC host triplet: i486-linux
GCC target triplet: i486-linux


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


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

* [Bug target/22599] Segfault with invalid asm usage
  2005-07-21 20:14 [Bug c/22599] New: Segfault with invalid asm usage schodet at efrei dot fr
@ 2005-07-21 20:33 ` pinskia at gcc dot gnu dot org
  2005-07-21 21:06 ` [Bug target/22599] ICE " pinskia at gcc dot gnu dot org
  2005-07-22  3:58 ` gnu at the-meissners dot org
  2 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-21 20:33 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |target
           Keywords|                            |ice-on-invalid-code


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


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

* [Bug target/22599] ICE with invalid asm usage
  2005-07-21 20:14 [Bug c/22599] New: Segfault with invalid asm usage schodet at efrei dot fr
  2005-07-21 20:33 ` [Bug target/22599] " pinskia at gcc dot gnu dot org
@ 2005-07-21 21:06 ` pinskia at gcc dot gnu dot org
  2005-07-22  3:58 ` gnu at the-meissners dot org
  2 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-21 21:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-21 20:38 -------
Confirmed, only the second example fails from 4.0.0 upwards.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-07-21 20:38:00
               date|                            |
            Summary|Segfault with invalid asm   |ICE with invalid asm usage
                   |usage                       |


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


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

* [Bug target/22599] ICE with invalid asm usage
  2005-07-21 20:14 [Bug c/22599] New: Segfault with invalid asm usage schodet at efrei dot fr
  2005-07-21 20:33 ` [Bug target/22599] " pinskia at gcc dot gnu dot org
  2005-07-21 21:06 ` [Bug target/22599] ICE " pinskia at gcc dot gnu dot org
@ 2005-07-22  3:58 ` gnu at the-meissners dot org
  2 siblings, 0 replies; 6+ messages in thread
From: gnu at the-meissners dot org @ 2005-07-22  3:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gnu at the-meissners dot org  2005-07-22 03:54 -------
I forgot to mention, the patch was against the mainline, sources current as of
July 20th.

-- 


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


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

* [Bug target/22599] ICE with invalid asm usage
       [not found] <bug-22599-4@http.gcc.gnu.org/bugzilla/>
@ 2021-08-08 19:52 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-08 19:52 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |4.4.0

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed back with r0-91401 for GCC 4.4.0.

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

* [Bug target/22599] ICE with invalid asm usage
       [not found] <bug-22599-11033@http.gcc.gnu.org/bugzilla/>
@ 2009-01-01 21:13 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-01-01 21:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2009-01-01 21:12 -------
The segfault has been changed into an error with PR 13506 but that does not
mean with RTL checking turned on.

In fact with RTL checking we get:
t.c: In function 'main':
t.c:13: internal compiler error: RTL check: expected elt 0 type 'e' or 'u',
have 'i' (rtx reg) in print_operand, at config/i386/i386.c:9010
Please submit a full bug report,
with preprocessed source if appropriate.

--- CUT ---
Michael, could you ping your patch?


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gnu at the-meissners dot org
   Last reconfirmed|2005-07-21 20:38:00         |2009-01-01 21:12:18
               date|                            |


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


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

end of thread, other threads:[~2021-08-08 19:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-21 20:14 [Bug c/22599] New: Segfault with invalid asm usage schodet at efrei dot fr
2005-07-21 20:33 ` [Bug target/22599] " pinskia at gcc dot gnu dot org
2005-07-21 21:06 ` [Bug target/22599] ICE " pinskia at gcc dot gnu dot org
2005-07-22  3:58 ` gnu at the-meissners dot org
     [not found] <bug-22599-11033@http.gcc.gnu.org/bugzilla/>
2009-01-01 21:13 ` pinskia at gcc dot gnu dot org
     [not found] <bug-22599-4@http.gcc.gnu.org/bugzilla/>
2021-08-08 19:52 ` pinskia 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).