Bug 42696 - lto1 error with -fsigned-char and char comparison
Summary: lto1 error with -fsigned-char and char comparison
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: lto (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: 4.5.1
Assignee: Richard Biener
URL:
Keywords: lto
Depends on:
Blocks:
 
Reported: 2010-01-12 00:49 UTC by Janis Johnson
Modified: 2010-07-20 15:06 UTC (History)
2 users (show)

See Also:
Host:
Target: powerpc64-linux
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-01-12 09:05:46


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Janis Johnson 2010-01-12 00:49:03 UTC
SPEC CPU2006 tests 464.h264ref and 482.sphinx3 fail to build on powerpc64-linux with "-m64 -lto -fsigned-char".  For some reason we've added the option -fsigned-char to the SPEC config files for those two tests; without it both tests fail at runtime for -m64, but it doesn't affect the results for -m32.  The failure to build with -flto might be due to some problem with -fsigned-char on powerpc64, rather than a problem with LTO.

Here's a minimized testcase:

---------------------
extern char *a;
extern int f;

void
foo (void)
{
  f = (*a != '-');
} 
---------------------

And here's what happens:

elm3b149% /home/janis/tools/gcc-trunk-anonsvn/bin/gcc -m64 -flto -fsigned-char bug.c -c
elm3b149% /home/janis/tools/gcc-trunk-anonsvn/bin/gcc -m64 -flto -fsigned-char bug.o -shared -o x.so
In function ‘foo’:
lto1: error: type mismatch in indirect reference
<unnamed-signed:8>
<unnamed-unsigned:8>

D.1228_2 = *a.0_1;

lto1: internal compiler error: verify_stmts failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper: /home/janis/tools/gcc-trunk-anonsvn/bin/gcc returned 1 exit status
collect2: lto-wrapper returned 1 exit status

If the type of 'a' is signed char then everything works fine.
Comment 1 Richard Biener 2010-01-12 09:05:46 UTC
Mine.  I hate -f[un]signed-char ...
Comment 2 Richard Biener 2010-07-20 15:06:18 UTC
Subject: Bug 42696

Author: rguenth
Date: Tue Jul 20 15:05:59 2010
New Revision: 162341

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162341
Log:
2010-07-20  Richard Guenther  <rguenther@suse.de>

	PR lto/42696
	* gcc.dg/lto/20100720-4_0.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/lto/20100720-4_0.c
Modified:
    trunk/gcc/testsuite/ChangeLog

Comment 3 Richard Biener 2010-07-20 15:06:32 UTC
Fixed.