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]

S/390: Fix PR target/20054


Hello,

this fixes PR 20054, see the Bugzilla log for explanation.

Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux,
applied to mainline.

Bye,
Ulrich

ChangeLog:

	PR target/20054
	* config/s390/s390.md ("*llgt_sidi", "*llgt_sidi_split"): Move to
	before the "*llgt_didi" pattern.

testsuite/ChangeLog:

	PR target/20054
	* gcc.dg/pr20054.c: New test.

Index: gcc/config/s390/s390.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.md,v
retrieving revision 1.153
diff -c -p -r1.153 s390.md
*** gcc/config/s390/s390.md	11 Feb 2005 14:40:55 -0000	1.153
--- gcc/config/s390/s390.md	18 Feb 2005 18:37:58 -0000
***************
*** 2660,2665 ****
--- 2660,2686 ----
  ; LLGT-type instructions (zero-extend from 31 bit to 64 bit).
  ;
  
+ (define_insn "*llgt_sidi"
+   [(set (match_operand:DI 0 "register_operand" "=d")
+         (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
+ 		(const_int 2147483647)))]
+   "TARGET_64BIT"
+   "llgt\t%0,%1"
+   [(set_attr "op_type"  "RXE")])
+ 
+ (define_insn_and_split "*llgt_sidi_split"
+   [(set (match_operand:DI 0 "register_operand" "=d")
+         (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
+ 		(const_int 2147483647)))
+    (clobber (reg:CC 33))]
+   "TARGET_64BIT"
+   "#"
+   "&& reload_completed"
+   [(set (match_dup 0)
+         (and:DI (subreg:DI (match_dup 1) 0)
+ 		(const_int 2147483647)))]
+   "")
+ 
  (define_insn "*llgt_sisi"
    [(set (match_operand:SI 0 "register_operand" "=d,d")
          (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,m")
***************
*** 2702,2728 ****
                  (const_int 2147483647)))]
    "")
  
- (define_insn "*llgt_sidi"
-   [(set (match_operand:DI 0 "register_operand" "=d")
-         (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
- 		(const_int 2147483647)))]
-   "TARGET_64BIT"
-   "llgt\t%0,%1"
-   [(set_attr "op_type"  "RXE")])
- 
- (define_insn_and_split "*llgt_sidi_split"
-   [(set (match_operand:DI 0 "register_operand" "=d")
-         (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
- 		(const_int 2147483647)))
-    (clobber (reg:CC 33))]
-   "TARGET_64BIT"
-   "#"
-   "&& reload_completed"
-   [(set (match_dup 0)
-         (and:DI (subreg:DI (match_dup 1) 0)
- 		(const_int 2147483647)))]
-   "")
- 
  ;
  ; zero_extendqidi2 instruction pattern(s)
  ;
--- 2723,2728 ----
*** /dev/null	Tue Oct 26 21:09:21 2004
--- gcc/testsuite/gcc.dg/pr20054.c	Fri Feb 18 19:33:58 2005
***************
*** 0 ****
--- 1,23 ----
+ 
+ /* { dg-do compile } */
+ /* { dg-options "-O2 -fno-strict-aliasing" } */
+ 
+ 
+ unsigned int *foo (void);
+ 
+ char *
+ bar (double *d)
+ {
+   return (char *) (d + 1) - sizeof (unsigned int);
+ }
+ 
+ char
+ baz (double x)
+ {
+   unsigned int h = *foo ();
+   unsigned int l = *(unsigned int *) bar (&x);
+ 
+   return (h & ~0x80000000L) == 0x7FF00000 && l == 0;
+ }
+ 
+ 
-- 
  Dr. Ulrich Weigand
  Linux on zSeries Development
  Ulrich.Weigand@de.ibm.com


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