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]

RE: [Bug target/14041] H8300-elf unaligned word/longword access of zero initialized variables


Hi,

Please find testcase below.
 
I have enabled testcase for h8300-*-elf only and passing -mh option. (For plain H8/300 it will generate .align 1 and test would fail)

-Dhananjay

Testsuite Changelog 

2004-02-11  Dhananjay Deshpande  <dhananjayd@kpitcummins.com>

        PR target/14041
        * gcc.dg/h8300-bss-align-1.c : New.

================================================================
--- /dev/null	Wed May  6 02:02:27 1998
+++ gcc.dg/h8300-bss-align-1.c	Wed Feb 11 18:06:42 2004
@@ -0,0 +1,13 @@
+/* Make sure that the H8 backend does align zero initialized variables. */
+/* { dg-do compile { target h8300-*-elf } } */
+/* { dg-options "-mh" } */
+
+struct s {
+  char a, b;
+  long c;
+};
+
+struct s s = {0};
+
+/* { dg-final { scan-assembler ".align 2" } } */
+

================================================================



> -----Original Message-----
> From: kazu at cs dot umass dot edu [mailto:gcc-bugzilla@gcc.gnu.org]
> Sent: Wednesday, February 11, 2004 7:24 AM
> To: Dhananjay R. Deshpande
> Subject: [Bug target/14041] H8300-elf unaligned word/longword 
> access of
> zero initialized variables
> 
> 
> 
> ------- Additional Comments From kazu at cs dot umass dot edu 
>  2004-02-11 01:54 -------
> Subject: Re:  H8300-elf unaligned word/longword access of
>  zero initialized variables
> 
> Hi Dhananjay,
> 
> > Updated patch - 
> > 
> > 2004-02-10  Dhananjay Deshpande  <dhananjayd@kpitcummins.com>
> > 
> >         PR target/14041
> >         * config/h8300/h8300.h (ASM_OUTPUT_ALIGNED_BSS): Define.
> 
> Thanks.  Could you also post a testcase?  You will most likely find
> the scan-assembler trick in gcc.dg useful.  Basically, you can search
> for ".align 2" in the compiled version of the testcase in comment #4
> of the PR.
> 
> Kazu Hirata
> 
> 
> -- 
> 
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14041
> 
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
> 


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