This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c/2618: gcc crashes when doing _Bool = (unsigned char & 0x1) ? 1 : 0



>Number:         2618
>Category:       c
>Synopsis:       gcc crashes when doing _Bool = (unsigned char & 0x1) ? 1 : 0
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 23 13:56:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Cesar Eduardo Barros
>Release:        gcc version 3.0 20010402 (Debian prerelease)
>Organization:
>Environment:
Debian i386 testing w/glibc 2.2.2-4
>Description:
When compiling the code:

gcc-3.0: Internal error: Segmentation fault (program cc1)
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
For Debian GNU/Linux specific bugs,
please see /usr/share/doc/debian/bug-reporting.txt.

CodeSourcery's gives me:

gcc: Internal error: Segmentation fault (program cc1)
Please submit a full bug report.
See for instructions.


>How-To-Repeat:
# 1 "teste.c"
# 1 "/usr/lib/gcc-lib/i386-linux/3.0/include/stdbool.h" 1 3
# 2 "teste.c" 2

_Bool x;
unsigned char y;

void fn(void)
{
        x = y & 0x1 ? 1 : 0;
}
>Fix:
A workaround is to declare y as unsigned instead of unsigned char.
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]