diff options
| author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-01-08 16:57:59 +0000 |
|---|---|---|
| committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-01-08 16:57:59 +0000 |
| commit | 3bfd70ae21d386b6ffecbdebc079364f149efa86 (patch) | |
| tree | 277fb6ae3b56b939e10755bbdebd16395350b1a0 | |
| parent | 01e31b4be25d710786e12f2a968fb3d1decf41ac (diff) | |
| download | ppe42-gcc-3bfd70ae21d386b6ffecbdebc079364f149efa86.tar.gz ppe42-gcc-3bfd70ae21d386b6ffecbdebc079364f149efa86.zip | |
2010-01-08 Richard Guenther <rguenther@suse.de>
PR lto/42528
* c.opt (fsigned-char): Also let LTO handle this option.
(funsigned-char): Likewise.
lto/
* lto-lang.c (lto_handle_option): Handle -f[un]signed-char.
(lto_init): Do not init char_type_node in a standard way
but according to flag_signed_char.
* gcc.dg/lto/20100103-1_0.c: New testcase.
* gcc.dg/lto/20100103-2_0.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155740 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/c.opt | 4 | ||||
| -rw-r--r-- | gcc/lto/ChangeLog | 7 | ||||
| -rw-r--r-- | gcc/lto/lto-lang.c | 13 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.dg/lto/20100103-1_0.c | 8 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.dg/lto/20100103-2_0.c | 12 |
7 files changed, 53 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 45f91b98cb2..4f7f36f8048 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-01-08 Richard Guenther <rguenther@suse.de> + + PR lto/42528 + * c.opt (fsigned-char): Also let LTO handle this option. + (funsigned-char): Likewise. + 2010-01-07 Richard Guenther <rguenther@suse.de> * gimple.h (gss_for_code): Wrap gcc_assert in ENABLE_CHECKING. diff --git a/gcc/c.opt b/gcc/c.opt index 429c035f38f..bdf9531ad80 100644 --- a/gcc/c.opt +++ b/gcc/c.opt @@ -769,7 +769,7 @@ C ObjC C++ ObjC++ When \"signed\" or \"unsigned\" is not given make the bitfield signed fsigned-char -C ObjC C++ ObjC++ +C ObjC C++ ObjC++ LTO Make \"char\" signed by default fsquangle @@ -802,7 +802,7 @@ C ObjC C++ ObjC++ When \"signed\" or \"unsigned\" is not given make the bitfield unsigned funsigned-char -C ObjC C++ ObjC++ +C ObjC C++ ObjC++ LTO Make \"char\" unsigned by default fuse-cxa-atexit diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 92e595fac67..5e52527a29f 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,10 @@ +2010-01-08 Richard Guenther <rguenther@suse.de> + + PR lto/42528 + * lto-lang.c (lto_handle_option): Handle -f[un]signed-char. + (lto_init): Do not init char_type_node in a standard way + but according to flag_signed_char. + 2010-01-03 H.J. Lu <hongjiu.lu@intel.com> PR lto/41564 diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c index 970265c2a74..05577a29371 100644 --- a/gcc/lto/lto-lang.c +++ b/gcc/lto/lto-lang.c @@ -632,6 +632,14 @@ lto_handle_option (size_t scode, const char *arg, int value ATTRIBUTE_UNUSED) warn_psabi = value; break; + case OPT_fsigned_char: + flag_signed_char = value; + break; + + case OPT_funsigned_char: + flag_signed_char = !value; + break; + default: break; } @@ -1036,8 +1044,11 @@ lto_init (void) /* Share char_type_node with whatever would be the default for the target. char_type_node will be used for internal types such as va_list_type_node but will not be present in the lto stream. */ + /* ??? This breaks the more common case of consistent but non-standard + setting of flag_signed_char, so share according to flag_signed_char. + See PR42528. */ char_type_node - = DEFAULT_SIGNED_CHAR ? signed_char_type_node : unsigned_char_type_node; + = flag_signed_char ? signed_char_type_node : unsigned_char_type_node; /* Tell the middle end what type to use for the size of objects. */ if (strcmp (SIZE_TYPE, "unsigned int") == 0) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e96fbd2d4a4..f21a58379ef 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2010-01-08 Richard Guenther <rguenther@suse.de> + + PR lto/42528 + * gcc.dg/lto/20100103-1_0.c: New testcase. + * gcc.dg/lto/20100103-2_0.c: Likewise. + 2010-01-08 Tobias Burnus <burnus@net-b.de PR/fortran 25829 diff --git a/gcc/testsuite/gcc.dg/lto/20100103-1_0.c b/gcc/testsuite/gcc.dg/lto/20100103-1_0.c new file mode 100644 index 00000000000..8e1b4841761 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20100103-1_0.c @@ -0,0 +1,8 @@ +/* { dg-lto-do link } */ +/* { dg-lto-options {{-funsigned-char -flto} {-fsigned-char -flto}} } */ + +char *foo; +int main() +{ + foo = "bar"; +} diff --git a/gcc/testsuite/gcc.dg/lto/20100103-2_0.c b/gcc/testsuite/gcc.dg/lto/20100103-2_0.c new file mode 100644 index 00000000000..1fb6a7b3e2a --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/20100103-2_0.c @@ -0,0 +1,12 @@ +/* { dg-lto-do link } */ +/* { dg-lto-options {{-O -flto -funsigned-char} {-O -flto -fsigned-char}} } */ + +char p[32] = ""; +int main () +{ + if (__builtin___strcpy_chk (p + 1, "vwxyz", + __builtin_object_size (p + 1, 0)) != p + 1) + __builtin_abort (); + return 0; +} + |

