Commit 9f9ab303 by Jeff Law Committed by Jeff Law

re PR target/17306 (function_vector attribute in H8300H/H8S)

	PR target/17306
	* config/h8300/constraints.md (U): Correctly dectect
	"eightbit_data" memory addresses.
	* config/h8300/h8300.c (eightbit_constant_address_p): Also
	handle (const (plus (symbol_ref (x)))) where x is declared
	as an 8-bit data memory address.
	* config/h8300/h8300.md (call, call_value): Correctly detect
	"funcvec" functions.

	PR target/17306
	* gcc.target/h8300/pr17306-1.c: New test.
	* gcc.target/h8300/pr17306-2.c: New test.

From-SVN: r220472
parent d00f6ca6
2015-02-05 Jeff Law <law@redhat.com> 2015-02-05 Jeff Law <law@redhat.com>
PR target/17306
* config/h8300/constraints.md (U): Correctly dectect
"eightbit_data" memory addresses.
* config/h8300/h8300.c (eightbit_constant_address_p): Also
handle (const (plus (symbol_ref (x)))) where x is declared
as an 8-bit data memory address.
* config/h8300/h8300.md (call, call_value): Correctly detect
"funcvec" functions.
PR target/43264 PR target/43264
* config/h8300/h8300.c (get_shift_alg): Fix ASHIFTRT by * config/h8300/h8300.c (get_shift_alg): Fix ASHIFTRT by
24 to 28 bits for the H8/300. 24 to 28 bits for the H8/300.
......
...@@ -188,7 +188,7 @@ ...@@ -188,7 +188,7 @@
(match_code "symbol_ref" "000") (match_code "symbol_ref" "000")
(match_code "const_int" "001") (match_code "const_int" "001")
(ior (match_test "TARGET_H8300S") (ior (match_test "TARGET_H8300S")
(match_test "SYMBOL_REF_FLAG (XEXP (XEXP (XEXP (op, 0), 0), 0))"))) (match_test "(SYMBOL_REF_FLAGS (XEXP (XEXP (XEXP (op, 0), 0), 0)) & SYMBOL_FLAG_EIGHTBIT_DATA) != 0")))
(and (match_code "mem") (and (match_code "mem")
(match_test "h8300_eightbit_constant_address_p (XEXP (op, 0))")) (match_test "h8300_eightbit_constant_address_p (XEXP (op, 0))"))
(and (match_code "mem") (and (match_code "mem")
......
...@@ -5637,6 +5637,12 @@ h8300_eightbit_constant_address_p (rtx x) ...@@ -5637,6 +5637,12 @@ h8300_eightbit_constant_address_p (rtx x)
if (GET_CODE (x) == SYMBOL_REF) if (GET_CODE (x) == SYMBOL_REF)
return (SYMBOL_REF_FLAGS (x) & SYMBOL_FLAG_EIGHTBIT_DATA) != 0; return (SYMBOL_REF_FLAGS (x) & SYMBOL_FLAG_EIGHTBIT_DATA) != 0;
if (GET_CODE (x) == CONST
&& GET_CODE (XEXP (x, 0)) == PLUS
&& GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF
&& (SYMBOL_REF_FLAGS (XEXP (XEXP (x, 0), 0)) & SYMBOL_FLAG_EIGHTBIT_DATA) != 0)
return 1;
if (GET_CODE (x) != CONST_INT) if (GET_CODE (x) != CONST_INT)
return 0; return 0;
......
...@@ -2499,7 +2499,7 @@ ...@@ -2499,7 +2499,7 @@
"" ""
{ {
if (GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF if (GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF
&& SYMBOL_REF_FLAG (XEXP (operands[0], 0))) && (SYMBOL_REF_FLAGS (XEXP (operands[0], 0)) & SYMBOL_FLAG_FUNCVEC_FUNCTION))
return "jsr\\t@%0:8"; return "jsr\\t@%0:8";
else else
return "jsr\\t%0"; return "jsr\\t%0";
...@@ -2522,7 +2522,7 @@ ...@@ -2522,7 +2522,7 @@
"" ""
{ {
if (GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF if (GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF
&& SYMBOL_REF_FLAG (XEXP (operands[1], 0))) && (SYMBOL_REF_FLAGS (XEXP (operands[1], 0)) & SYMBOL_FLAG_FUNCVEC_FUNCTION))
return "jsr\\t@%1:8"; return "jsr\\t@%1:8";
else else
return "jsr\\t%1"; return "jsr\\t%1";
......
2015-02-05 Jeff Law <law@redhat.com>
PR target/17306
* gcc.target/h8300/pr17306-1.c: New test.
* gcc.target/h8300/pr17306-2.c: New test.
2015-02-05 Tobias Burnus <burnus@net-b.de> 2015-02-05 Tobias Burnus <burnus@net-b.de>
PR fortran/64943 PR fortran/64943
......
/* { dg-do compile } */
/* { dg-options "-mh" } */
/* { dg-final { scan-assembler-times "@@" 1 } } */
void foo (void) __attribute__ ((function_vector));
__attribute__((noinline)) void foo (void)
{
}
void bar (void)
{
foo();
}
/* { dg-do compile } */
/* { dg-options "-mh -O2 -w" } */
/* { dg-final { scan-assembler-times ":8" 2 } } */
struct x {
char x;
char y;
};
struct x __attribute__ ((eightbit_data)) foo;
int bar ()
{
if ((foo.y & 0x80) != 0)
oof ();
}
int com ()
{
if ((foo.x & 0x80) != 0)
oof ();
}
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