OSDN Git Service

* function.c (purge_addressof_1): Handle case when a register
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Jan 1999 11:35:30 +0000 (11:35 +0000)
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Jan 1999 11:35:30 +0000 (11:35 +0000)
has been used in a wider mode.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@24887 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/function.c

index 0d6b33f..6da65ee 100644 (file)
@@ -1,3 +1,8 @@
+Wed Jan 27 19:31:36 1999  J"orn Rennecke <amylaar@cygnus.co.uk>
+
+       * function.c (purge_addressof_1): Handle case when a register
+       has been used in a wider mode.
+
 Wed Jan 27 11:58:18 1999  Dave Brolley  <brolley@cygnus.com>
 
        * cpplib.h (cpp_notice): Add prototype.
index 90540d7..e2c836d 100644 (file)
@@ -2939,7 +2939,20 @@ purge_addressof_1 (loc, insn, force, store)
                              < GET_MODE_SIZE (GET_MODE (y)))
                            abort ();
 
-                         z = gen_lowpart (GET_MODE (x), z);
+                         if (GET_MODE_SIZE (GET_MODE (x)) > UNITS_PER_WORD
+                             && (GET_MODE_SIZE (GET_MODE (x))
+                                 > GET_MODE_SIZE (GET_MODE (z))))
+                           {
+                             /* This can occur as a result in invalid
+                                pointer casts, e.g. float f; ... 
+                                *(long long int *)&f.
+                                ??? We could emit a warning here, but
+                                without a line number that wouldn't be
+                                very helpful.  */
+                             z = gen_rtx_SUBREG (GET_MODE (x), z, 0);
+                           }
+                         else
+                           z = gen_lowpart (GET_MODE (x), z);
                        }
 
                      *loc = z;