Bug 189806 - internal compiler error: in tree_low_cst
internal compiler error: in tree_low_cst
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2006-04-24 16:04 EDT by Enrico Scholz
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-04-25 04:54:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 27301 None None None Never

  None (edit)
Description Enrico Scholz 2006-04-24 16:04:35 EDT
Description of problem:

While trying to write a memset() implementation which will not be optimized
away, I ran into the following ICE:

$ cat foo.c
#include <string.h>
inline static void *xmemset(void *ptr, char v, size_t n)
        void *res = memset(ptr, v, n);
        __asm__ __volatile__("" : : "m" 
                ( __extension__ ({ struct { char x[n]; } *p = ptr; *p; }) ));

        return res;

void foo(void)
        char password[16];
        xmemset(password, 0, sizeof password);

$ LANG=C gcc foo.c -c 
foo.c: In function 'xmemset':
foo.c:4: internal compiler error: in tree_low_cst, at tree.c:4461
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccCFdrCZ.out file, please attach this to
your bugreport.

Version-Release number of selected component (if applicable):


How reproducible:

Comment 1 Enrico Scholz 2006-04-24 16:10:02 EDT
yet more... when writing plain 'p' instead of '*p':

|    ( __extension__ ({ struct { char x[n]; } *p = ptr; p; }) ));

I get

foo.c: In function 'foo':
foo.c:13: internal compiler error: in bitmap_first_set_bit, at bitmap.c:535
Please submit a full bug report,
Comment 2 Jakub Jelinek 2006-04-25 04:54:53 EDT
Just use "m" (*(struct { char x[n]; } *)ptr) instead (or better yet just use
"memory" clobber).
Filling upstream.

Note You need to log in before you can comment on or make changes to this bug.