From 2eea716d5f123a8cd750e0772794de9427b17d2a Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sun, 8 Nov 2009 22:12:52 +0100 Subject: re PR target/41985 (Internal compiler error reported.) PR target/41985 * config/i386/i386.c (get_some_local_dynamic_name): Don't assert function contains at least one local dynamic name. (print_operand) : Instead output operand lossage diagnostics here if that happens. * gcc.target/i386/pr41985.c: New test. From-SVN: r154014 --- gcc/ChangeLog | 8 ++++++++ gcc/config/i386/i386.c | 13 ++++++++++--- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr41985.c | 11 +++++++++++ 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr41985.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index aeb880e..fcf7973 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2009-11-08 Jakub Jelinek + + PR target/41985 + * config/i386/i386.c (get_some_local_dynamic_name): Don't assert + function contains at least one local dynamic name. + (print_operand) : Instead output operand lossage diagnostics + here if that happens. + 2009-11-08 Zbigniew Chamski Joern Rennecke diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 2031dfb..da7e8f9 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -11301,7 +11301,7 @@ get_some_local_dynamic_name (void) && for_each_rtx (&PATTERN (insn), get_some_local_dynamic_name_1, 0)) return cfun->machine->some_ld_name; - gcc_unreachable (); + return NULL; } /* Meaning of CODE: @@ -11353,8 +11353,15 @@ print_operand (FILE *file, rtx x, int code) return; case '&': - assemble_name (file, get_some_local_dynamic_name ()); - return; + { + const char *name = get_some_local_dynamic_name (); + if (name == NULL) + output_operand_lossage ("'%%&' used without any " + "local dynamic TLS references"); + else + assemble_name (file, name); + return; + } case 'A': switch (ASSEMBLER_DIALECT) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9282ec3..550315a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-11-08 Jakub Jelinek + + PR target/41985 + * gcc.target/i386/pr41985.c: New test. + 2009-11-08 Richard Guenther * gcc.dg/torture/pta-escape-1.c: New testcase. diff --git a/gcc/testsuite/gcc.target/i386/pr41985.c b/gcc/testsuite/gcc.target/i386/pr41985.c new file mode 100644 index 0000000..b38b6dc --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr41985.c @@ -0,0 +1,11 @@ +/* PR target/41985 */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +int +main () +{ + int i; + asm volatile ("# %&": : "g" (i)); /* { dg-error "used without any local dynamic TLS references" } */ + return 0; +} -- cgit v1.1