This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [PATCH] Fix PR rtl-optimization/23585 (delay slots)


> This patch breaks (at least) for the latest gcc 4.0 on mips-linux
> with the attached testcase:
>
> $ build/gcc/xgcc -Bbuild/gcc -O2 -mabi=64 -c -o testcase testcase.c
> testcase.c: In function 'direct2indirect':
> testcase.c:57: internal compiler error: Floating point exception
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <URL:http://gcc.gnu.org/bugs.html> for instructions.
> For Debian GNU/Linux specific bug reporting instructions,
> see <URL:file:///usr/share/doc/gcc-4.0/README.Bugs>.

Sorry about that, obvious hole in the patch.

> Reverting this single line of it lets the testcase build successfully.
>
> --- src/gcc/reorg.c.old	2005-09-03 21:09:51.000000000 +0200
> +++ src/gcc/reorg.c	2005-10-31 23:16:47.000000000 +0100
> @@ -2653,7 +2653,7 @@ fill_slots_from_thread (rtx insn, rtx co
>  	  if (!must_annul
>  	      && (condition == const_true_rtx
>
>  	          || (! insn_sets_resource_p (trial, &opposite_needed, 1)
>
> -		      && ! may_trap_or_fault_p (pat))))
> +		      && ! may_trap_p (pat))))
>  	    {
>  	      old_trial = trial;
>  	      trial = try_split (pat, trial, 0);
>
> I don't know if this is a proper fix or only a workaround which happens
> to work on mips.

That would essentially defeat the purpose of the original patch, as reorg 
really should use may_trap_or_fault_p and not may_trap_p.


Ian, I presume you meant that rtx_addr_can_trap_p_1 should return 0, right?


2005-11-02  Eric Botcazou  <ebotcazou@libertysurf.fr>

	PR rtl-optimization/23585
	* rtlanal.c (rtx_addr_can_trap_p_1) <PLUS>: Return 0 for an address
	that can't trap plus a constant integer, if the mode has zero size.


-- 
Eric Botcazou
Index: rtlanal.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtlanal.c,v
retrieving revision 1.221
diff -u -p -r1.221 rtlanal.c
--- rtlanal.c	20 Oct 2005 12:14:29 -0000	1.221
+++ rtlanal.c	2 Nov 2005 09:32:05 -0000
@@ -267,7 +267,9 @@ rtx_addr_can_trap_p_1 (rtx x, enum machi
 	{
 	  HOST_WIDE_INT offset;
 
-	  if (!STRICT_ALIGNMENT || !unaligned_mems)
+	  if (!STRICT_ALIGNMENT
+	      || !unaligned_mems
+	      || GET_MODE_SIZE (mode) == 0)
 	    return 0;
 
 	  offset = INTVAL (XEXP (x, 1));

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