Commit 02143d0b by Uros Bizjak

re PR target/42448 (Wrong code with _Complex char in structure)

	PR target/42448
	* config/alpha/predicates.md (aligned_memory_operand): Return false
	for CQImode.
	(unaligned_memory_operand): Return true for CQImode.
	* config/alpha/alpha.c (get_aligned_mem): Assert that location
	doesn not cross aligned SImode word boundary.

testsuite/ChangeLog:

	PR target/42448
	* gcc.target/alpha/pr42448-1.c: New test.
	* gcc.target/alpha/pr42448-2.c: Ditto.

From-SVN: r155566
parent 7413962d
2010-01-02 Uros Bizjak <ubizjak@gmail.com>
PR target/42448
* config/alpha/predicates.md (aligned_memory_operand): Return false
for CQImode.
(unaligned_memory_operand): Return true for CQImode.
* config/alpha/alpha.c (get_aligned_mem): Assert that location
doesn not cross aligned SImode word boundary.
2010-01-02 Anatoly Sokolov <aesok@post.ru> 2010-01-02 Anatoly Sokolov <aesok@post.ru>
* config/avr/avr.h (REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, * config/avr/avr.h (REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, XEXP_):
XEXP_) : Remove. Remove.
* config/avr/avr-protos.h (avr_init_once, avr_optimization_options, * config/avr/avr-protos.h (avr_init_once, avr_optimization_options,
avr_change_section, avr_reg_class_from_letter) : Remove declaration. avr_change_section, avr_reg_class_from_letter) : Remove declaration.
...@@ -15,8 +24,7 @@ ...@@ -15,8 +24,7 @@
2010-01-01 Richard Guenther <rguenther@suse.de> 2010-01-01 Richard Guenther <rguenther@suse.de>
PR debug/42455 PR debug/42455
* tree-sra.c (analyze_all_variable_accesses): Work in DECL_UID * tree-sra.c (analyze_all_variable_accesses): Work in DECL_UID order.
order.
2010-01-01 Richard Guenther <rguenther@suse.de> 2010-01-01 Richard Guenther <rguenther@suse.de>
......
...@@ -1475,6 +1475,10 @@ get_aligned_mem (rtx ref, rtx *paligned_mem, rtx *pbitnum) ...@@ -1475,6 +1475,10 @@ get_aligned_mem (rtx ref, rtx *paligned_mem, rtx *pbitnum)
else else
offset = disp & 3; offset = disp & 3;
/* The location should not cross aligned word boundary. */
gcc_assert (offset + GET_MODE_SIZE (GET_MODE (ref))
<= GET_MODE_SIZE (SImode));
/* Access the entire aligned word. */ /* Access the entire aligned word. */
*paligned_mem = widen_memory_access (ref, SImode, -offset); *paligned_mem = widen_memory_access (ref, SImode, -offset);
......
...@@ -442,6 +442,10 @@ ...@@ -442,6 +442,10 @@
if (MEM_ALIGN (op) >= 32) if (MEM_ALIGN (op) >= 32)
return 1; return 1;
if (mode == CQImode)
return 0;
op = XEXP (op, 0); op = XEXP (op, 0);
/* LEGITIMIZE_RELOAD_ADDRESS creates (plus (plus reg const_hi) const_lo) /* LEGITIMIZE_RELOAD_ADDRESS creates (plus (plus reg const_hi) const_lo)
...@@ -470,6 +474,10 @@ ...@@ -470,6 +474,10 @@
if (MEM_ALIGN (op) >= 32) if (MEM_ALIGN (op) >= 32)
return 0; return 0;
if (mode == CQImode)
return 1;
op = XEXP (op, 0); op = XEXP (op, 0);
/* LEGITIMIZE_RELOAD_ADDRESS creates (plus (plus reg const_hi) const_lo) /* LEGITIMIZE_RELOAD_ADDRESS creates (plus (plus reg const_hi) const_lo)
......
2010-01-02 Uros Bizjak <ubizjak@gmail.com>
PR target/42448
* gcc.target/alpha/pr42448-1.c: New test.
* gcc.target/alpha/pr42448-2.c: Ditto.
2010-01-01 Joseph Myers <joseph@codesourcery.com> 2010-01-01 Joseph Myers <joseph@codesourcery.com>
PR preprocessor/41947 PR preprocessor/41947
......
/* { dg-do run } */
/* { dg-options "-mcpu=21064 -O0" } */
extern void abort (void);
struct S2180
{
char t;
_Complex char u[2];
};
struct S2180 s2180;
int
main (void)
{
volatile struct S2180 x;
s2180.u[1] = 3 + 4i;
x.u[1] = s2180.u[1];
if (x.u[1] != s2180.u[1])
abort ();
return 0;
}
/* { dg-do run } */
/* { dg-options "-mcpu=21064 -O0" } */
extern void abort (void);
struct S2180
{
char t;
_Complex char u[4];
};
struct S2180 s2180;
int
main (void)
{
volatile struct S2180 x;
s2180.u[3] = 3 + 4i;
x.u[3] = s2180.u[3];
if (x.u[3] != s2180.u[3])
abort ();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment