RFC: PATCH: PR gas/12049: Unnecessary relaxation

H.J. Lu hjl.tools@gmail.com
Mon Oct 25 09:19:00 GMT 2010


On Sun, Oct 24, 2010 at 8:03 PM, Alan Modra <amodra@gmail.com> wrote:
> On Fri, Oct 22, 2010 at 12:44:21PM -0700, H.J. Lu wrote:
>> Your fix doesn't handle the new testcase in
>>
>> http://sourceware.org/bugzilla/show_bug.cgi?id=12049
>
> The comment says it all.
>
>        PR gas/12049
>        * write.c (relax_frag): Don't allow forward branches to temporarily
>        becomde backward branches.
>

I added this testcase.

Thanks.


-- 
H.J.
---
2010-10-25  H.J. Lu  <hongjiu.lu@intel.com>

	PR gas/12049
	* gas/i386/i386.exp: Run relax-1 and relax-2 for all 32bit
	targets.  Run x86-64-relax-1.

	* gas/i386/x86-64-relax-1.d: New.
	* gas/i386/x86-64-relax-1.s: Likewise.
-------------- next part --------------
2010-10-25  H.J. Lu  <hongjiu.lu@intel.com>

	PR gas/12049
	* gas/i386/i386.exp: Run relax-1 and relax-2 for all 32bit
	targets.  Run x86-64-relax-1.

	* gas/i386/x86-64-relax-1.d: New.
	* gas/i386/x86-64-relax-1.s: Likewise.

diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index 18710f9..fd58530 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -42,6 +42,8 @@ if [expr ([istarget "i*86-*-*"] ||  [istarget "x86_64-*-*"]) && [gas_32_check]]
     run_dump_test "amd"
     run_dump_test "katmai"
     run_dump_test "jump"
+    run_dump_test "relax-1"
+    run_dump_test "relax-2"
     run_dump_test "ssemmx2"
     run_dump_test "sse2"
     run_dump_test "sub"
@@ -199,8 +201,6 @@ if [expr ([istarget "i*86-*-*"] ||  [istarget "x86_64-*-*"]) && [gas_32_check]]
 	run_dump_test "intelpic"
 
 	run_dump_test "relax"
-	run_dump_test "relax-1"
-	run_dump_test "relax-2"
 	run_dump_test "gotpc"
 	run_dump_test "tlsd"
 	run_dump_test "tlspic"
@@ -272,6 +272,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t
     run_list_test "x86-64-segment" "-al"
     run_list_test "x86-64-inval-seg" "-al"
     run_dump_test "x86-64-branch"
+    run_dump_test "x86-64-relax-1"
     run_dump_test "svme64"
     run_dump_test "x86-64-amdfam10"
     run_dump_test "x86-64-vmx"
--- /dev/null	2010-10-22 08:50:39.580301504 -0700
+++ binutils/gas/testsuite/gas/i386/x86-64-relax-1.d	2010-10-25 02:12:05.953747768 -0700
@@ -0,0 +1,14 @@
+#name: x86-64 relax 1
+#objdump: -dw
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <.text>:
+#...
+ 358:	74 06                	je     0x360
+ 35a:	66 0f 1f 44 00 00    	nopw   0x0\(%rax,%rax,1\)
+ 360:	90                   	nop
+#pass
--- /dev/null	2010-10-22 08:50:39.580301504 -0700
+++ binutils/gas/testsuite/gas/i386/x86-64-relax-1.s	2010-10-25 02:04:45.965860490 -0700
@@ -0,0 +1,70 @@
+	.text
+	je	.LBB0_46
+        .zero 6, 0x90
+	je	.LBB0_46
+.LBB0_8:
+        .zero 134, 0x90
+	je	.LBB0_8
+        .zero 4, 0x90
+	je	.LBB0_8
+        .zero 8, 0x90
+	je	.LBB0_46
+        .zero 10, 0x90
+	je	.LBB0_8
+        .zero 4, 0x90
+	je	.LBB0_8
+	movq	304(%rsp), %r14
+        .zero 2, 0x90
+	je	.LBB0_8
+	je	.LBB0_8
+	movq	256(%rsp), %r14
+        .zero 3, 0x90
+	je	.LBB0_46
+        .zero 10, 0x90
+	je	.LBB0_8
+        .zero 13, 0x90
+	je	.LBB0_8
+	leaq	432(%rsp), %rsi
+	je	.LBB0_8
+	movq	176(%rsp), %r14
+	je	.LBB0_46
+	je	.LBB0_8
+	je	.LBB0_8
+	leaq	424(%rsp), %rsi
+	je	.LBB0_8
+        .zero 22, 0x90
+	je	.LBB0_8
+        .zero 11, 0x90
+	je	.LBB0_8
+	leaq	416(%rsp), %rsi
+	je	.LBB0_8
+        .zero 21, 0x90
+	je	.LBB0_46
+        .zero 8, 0x90
+	je	.LBB0_8
+        .zero 11, 0x90
+	je	.LBB0_8
+        .zero 7, 0x90
+	je	.LBB0_8
+        .zero 22, 0x90
+	je	.LBB0_46
+        .zero 131, 0x90
+.LBB0_46:
+	.align	16, 0x90
+	movq	168(%rsp), %rax
+        .zero 3, 0x90
+	je	.LBB1_35
+	.align	16, 0x90
+        .zero 2, 0x90
+	je	.LBB1_35
+        .zero 37, 0x90
+	je	.LBB1_35
+        .zero 59, 0x90
+	je	.LBB1_35
+        .zero 68, 0x90
+	je	.LBB1_17
+	.align	16, 0x90
+.LBB1_17:
+        .zero 85, 0x90
+.LBB1_35:
+	nop


More information about the Binutils mailing list