diff mbox

Fix AVR ICEs with -fpic (PR target/56455)

Message ID 20130226211739.GB12913@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Feb. 26, 2013, 9:17 p.m. UTC
Hi!

As the PR shows, alpha-vms wasn't the only target which doesn't
define ASM_OUTPUT_ADDR_DIFF_ELT, avr is another one, and I can find
several others.

So, either we put this check back, or we need to adjust all those targets
to disable flag_jump_tables for flag_pic.

2013-02-26  Jakub Jelinek  <jakub@redhat.com>

	PR target/56455
	* stmt.c (expand_switch_as_decision_tree_p): If flag_pic
	and ASM_OUTPUT_ADDR_DIFF_ELT isn't defined, return true.


	Jakub

Comments

Steven Bosscher Feb. 26, 2013, 9:25 p.m. UTC | #1
On Tue, Feb 26, 2013 at 10:17 PM, Jakub Jelinek wrote:
> Hi!
>
> As the PR shows, alpha-vms wasn't the only target which doesn't
> define ASM_OUTPUT_ADDR_DIFF_ELT, avr is another one, and I can find
> several others.

Not sure how I came to that conclusion...


> So, either we put this check back, or we need to adjust all those targets
> to disable flag_jump_tables for flag_pic.

Let's just put it back for now. It'll be hookized for GCC 4.9.

Ciao!
Steven
diff mbox

Patch

--- gcc/stmt.c.jj	2013-01-11 09:03:17.000000000 +0100
+++ gcc/stmt.c	2013-02-26 12:43:16.362812625 +0100
@@ -1760,6 +1760,10 @@  expand_switch_as_decision_tree_p (tree r
     return true;
   if (!flag_jump_tables)
     return true;
+#ifndef ASM_OUTPUT_ADDR_DIFF_ELT
+  if (flag_pic)
+    return true;
+#endif
 
   /* If the switch is relatively small such that the cost of one
      indirect jump on the target are higher than the cost of a