* RFA: Fix resource.c handling of unspec_volatile
@ 2008-06-30 21:23 Richard Sandiford
2008-07-02 1:22 ` Ian Lance Taylor
0 siblings, 1 reply; 2+ messages in thread
From: Richard Sandiford @ 2008-06-30 21:23 UTC (permalink / raw)
To: gcc-patches
This patch fixes some libgomp.fortran/nested1.f90 and
libfortran/reference1.f90 failures for MIPS. The problem was that,
when looking for used registers, resource.c:mark_referenced_resources
did not look inside the UNSPEC_VOLATILE part of a sync instruction.
It therefore mistakenly thought that one of the sync operands was dead.
It's unsafe in general to ignore operands, so I think we should
extend the TRAP_IF behaviour to UNSPEC_VOLATILE and ASM_INPUT.
Tested on mips64el-linux-gnu and x86_64-linux-gnu (as a sanity check).
OK to install?
Richard
gcc/
* resource.c (mark_referenced_resources): Look inside
UNSPEC_VOLATILEs and ASM_INPUTs.
Index: gcc/resource.c
===================================================================
--- gcc/resource.c 2008-06-29 22:42:24.000000000 +0100
+++ gcc/resource.c 2008-06-29 22:42:58.000000000 +0100
@@ -266,13 +266,10 @@ mark_referenced_resources (rtx x, struct
return;
case UNSPEC_VOLATILE:
+ case TRAP_IF:
case ASM_INPUT:
/* Traditional asm's are always volatile. */
res->volatil = 1;
- return;
-
- case TRAP_IF:
- res->volatil = 1;
break;
case ASM_OPERANDS:
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-02 1:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-30 21:23 RFA: Fix resource.c handling of unspec_volatile Richard Sandiford
2008-07-02 1:22 ` Ian Lance Taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).