Bug 19093 - g++.dg/opt/max1.C fails on ia64 and x86_64
Summary: g++.dg/opt/max1.C fails on ia64 and x86_64
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 3.3.6
Assignee: Andrew Pinski
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-20 19:55 UTC by Andrew Pinski
Modified: 2004-12-20 21:12 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-12-20 20:00:59


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2004-12-20 19:55:45 UTC
g++.dg/opt/max1.C still failed on both Linux/ia64 and Linux/x86_64:

http://gcc.gnu.org/ml/gcc-testresults/2004-12/msg00919.html
http://gcc.gnu.org/ml/gcc-testresults/2004-12/msg00923.html

They are both 64bit targets.
Comment 1 Andrew Pinski 2004-12-20 20:00:58 UTC
Actually it is just the testcase is invalid for 64bit targets (woops, my fault since I made it).
This patch should fix the problem:
Index: g++.dg/opt/max1.C
===============================================================
====
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.dg/opt/max1.C,v
retrieving revision 1.2
diff -u -p -r1.2 max1.C
--- g++.dg/opt/max1.C	19 Dec 2004 20:11:15 -0000	1.2
+++ g++.dg/opt/max1.C	20 Dec 2004 19:59:13 -0000
@@ -10,7 +10,7 @@ long fff[10];
 void f(long a)
 {
   int i;
-  a =  *((long*)(a+5)) >? *((long*)(a+1)); 
+  a =  *((long*)(a+1+sizeof(long))) >? *((long*)(a+1)); 
 
   for(i=0;i<10;i++)
    fff[i] = a;


I will apply it to all the branches where this is effected, 3.3, 3.4, and the mainline when I get home later 
today.
Comment 2 GCC Commits 2004-12-20 21:07:21 UTC
Subject: Bug 19093

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pinskia@gcc.gnu.org	2004-12-20 21:07:14

Modified files:
	gcc/testsuite  : ChangeLog 
	gcc/testsuite/g++.dg/opt: max1.C 

Log message:
	2004-12-20  Andrew Pinski  <pinskia@physics.uc.edu>
	
	PR other/19093
	* g++.dg/opt/max1.C: Fix for 64bit targets.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4786&r2=1.4787
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/max1.C.diff?cvsroot=gcc&r1=1.2&r2=1.3

Comment 3 GCC Commits 2004-12-20 21:09:48 UTC
Subject: Bug 19093

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	pinskia@gcc.gnu.org	2004-12-20 21:09:37

Modified files:
	gcc/testsuite  : ChangeLog 
	gcc/testsuite/g++.dg/opt: max1.C 

Log message:
	2004-12-20  Andrew Pinski  <pinskia@physics.uc.edu>
	
	PR other/19093
	* g++.dg/opt/max1.C: Fix for 64bit targets.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.333&r2=1.3389.2.334
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/max1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.1.2.1&r2=1.1.2.2

Comment 4 GCC Commits 2004-12-20 21:12:39 UTC
Subject: Bug 19093

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	pinskia@gcc.gnu.org	2004-12-20 21:12:34

Modified files:
	gcc/testsuite  : ChangeLog 
	gcc/testsuite/g++.dg/opt: max1.C 

Log message:
	2004-12-20  Andrew Pinski  <pinskia@physics.uc.edu>
	
	PR other/19093
	* g++.dg/opt/max1.C: Fix for 64bit targets.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.391&r2=1.2261.2.392
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/max1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2.2.1&r2=1.2.2.2

Comment 5 Andrew Pinski 2004-12-20 21:12:53 UTC
Fixed.