[Bug middle-end/49191] gcc.dg/memcpy-3.c FAILs on SPARC

2014-08-20 Thread sje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49191

--- Comment #17 from Steve Ellcey  ---
Author: sje
Date: Wed Aug 20 15:57:42 2014
New Revision: 214227

URL: https://gcc.gnu.org/viewcvs?rev=214227&root=gcc&view=rev
Log:
2014-08-20  Steve Ellcey  

PR middle-end/49191
* lib/target-supports.exp (check_effective_target_non_strict_align):
Add function description.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/lib/target-supports.exp


[Bug middle-end/49191] gcc.dg/memcpy-3.c FAILs on SPARC

2014-08-20 Thread sje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49191

--- Comment #16 from Steve Ellcey  ---
Author: sje
Date: Wed Aug 20 15:56:45 2014
New Revision: 214226

URL: https://gcc.gnu.org/viewcvs?rev=214226&root=gcc&view=rev
Log:
2014-08-20  Steve Ellcey  

PR middle-end/49191
* doc/sourcebuild.texi (non_strict_align): New.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/doc/sourcebuild.texi


[Bug middle-end/49191] gcc.dg/memcpy-3.c FAILs on SPARC

2011-06-27 Thread ebotcazou at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49191

Eric Botcazou  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.6.2

--- Comment #15 from Eric Botcazou  2011-06-27 
18:07:07 UTC ---
Thanks for the fix.


[Bug middle-end/49191] gcc.dg/memcpy-3.c FAILs on SPARC

2011-06-27 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49191

--- Comment #14 from Jakub Jelinek  2011-06-27 
17:55:40 UTC ---
Author: jakub
Date: Mon Jun 27 17:55:35 2011
New Revision: 175544

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175544
Log:
Backported from mainline
2011-06-26  Jakub Jelinek  

PR tree-optimization/48377
* gcc.dg/vect/pr48377.c: Add dg-require-effective-target
non_strict_align.

2011-06-26  Steve Ellcey  

PR middle-end/49191
* lib/target-supports.exp (check_effective_target_non_strict_align):
New.

Modified:
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
branches/gcc-4_6-branch/gcc/testsuite/gcc.dg/vect/pr48377.c
branches/gcc-4_6-branch/gcc/testsuite/lib/target-supports.exp


[Bug middle-end/49191] gcc.dg/memcpy-3.c FAILs on SPARC

2011-06-26 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49191

--- Comment #13 from Jakub Jelinek  2011-06-26 
07:58:23 UTC ---
Author: jakub
Date: Sun Jun 26 07:57:30 2011
New Revision: 175408

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175408
Log:
2011-06-26  Jakub Jelinek  

PR tree-optimization/48377
* gcc.dg/vect/pr48377.c: Add dg-require-effective-target
non_strict_align.

2011-06-26  Steve Ellcey  

PR middle-end/49191
* lib/target-supports.exp (check_effective_target_non_strict_align):
New.
* gcc.dg/memcpy-3.c: Add dg-require-effective-target non_strict_align.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/memcpy-3.c
trunk/gcc/testsuite/gcc.dg/vect/pr48377.c
trunk/gcc/testsuite/lib/target-supports.exp


[Bug middle-end/49191] gcc.dg/memcpy-3.c FAILs on SPARC

2011-06-08 Thread sje at cup dot hp.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49191

--- Comment #12 from Steve Ellcey  2011-06-08 20:07:04 
UTC ---
Checking for a warning using check_no_compiler_messages seems as easy or easier
then checking the return code so I did that.  I have submitted a patch to
gcc-patches.

http://gcc.gnu.org/ml/gcc-patches/2011-06/msg00673.html


[Bug middle-end/49191] gcc.dg/memcpy-3.c FAILs on SPARC

2011-06-08 Thread ebotcazou at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49191

Eric Botcazou  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2011.06.08 19:12:29
 Ever Confirmed|0   |1

--- Comment #11 from Eric Botcazou  2011-06-08 
19:12:29 UTC ---
> I get a warning on IA64 but none on X86.  The warning is coming from
> c-typeck.c.
> 
> x.c: In function 'foo':
> x.c:6:13: warning: cast increases required alignment of target type
> [-Wcast-align]

The warning is predicated on STRICT_ALIGNMENT being nonzero so this seems to be
a good idea.  You could add -Werror to get an error and test the exit code.


[Bug middle-end/49191] gcc.dg/memcpy-3.c FAILs on SPARC

2011-06-08 Thread sje at cup dot hp.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49191

--- Comment #10 from Steve Ellcey  2011-06-08 18:12:40 
UTC ---
How about compiling this with -Wcast-align and looking for a warning message:

char *y;
typedef char __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) c;
c *z;
void foo(void)
{
z = (c *) y;
}


I get a warning on IA64 but none on X86.  The warning is coming from
c-typeck.c.

x.c: In function 'foo':
x.c:6:13: warning: cast increases required alignment of target type
[-Wcast-align]


[Bug middle-end/49191] gcc.dg/memcpy-3.c FAILs on SPARC

2011-06-08 Thread dave at hiauly1 dot hia.nrc.ca
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49191

--- Comment #9 from dave at hiauly1 dot hia.nrc.ca 2011-06-08 17:59:18 UTC ---
> Perhaps something like:
> union { int i; char c[8]; } u;
> int
> main ()
> {
>   int *p;
>   asm volatile ("" : "=r" (p) : "0" (&u.c[1]));
>   *p++;
>   return 0;
> }
> compile+run and check for zero exit code?  Perhaps __ia64__ should be
> explicitly listed as strict alignment in addition to that, because I believe 
> it
> will
> succeed there, just with annoying messages in dmesg.

Same on hppa-linux.  Kernel will fixup unaligned access.

Dave


[Bug middle-end/49191] gcc.dg/memcpy-3.c FAILs on SPARC

2011-06-08 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49191

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek  2011-06-08 
17:47:32 UTC ---
Perhaps something like:
union { int i; char c[8]; } u;
int
main ()
{
  int *p;
  asm volatile ("" : "=r" (p) : "0" (&u.c[1]));
  *p++;
  return 0;
}
compile+run and check for zero exit code?  Perhaps __ia64__ should be
explicitly listed as strict alignment in addition to that, because I believe it
will
succeed there, just with annoying messages in dmesg.


[Bug middle-end/49191] gcc.dg/memcpy-3.c FAILs on SPARC

2011-06-08 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49191

--- Comment #8 from Jakub Jelinek  2011-06-08 
17:48:11 UTC ---
I meant (*p)++; instead of *p++; sorry.


[Bug middle-end/49191] gcc.dg/memcpy-3.c FAILs on SPARC

2011-06-08 Thread sje at cup dot hp.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49191

Steve Ellcey  changed:

   What|Removed |Added

 CC||sje at cup dot hp.com

--- Comment #6 from Steve Ellcey  2011-06-08 17:35:43 
UTC ---
What would be the best way to implement 'dg-effective-target strict-align'?
A target list would be the easiest but a program that can pass/fail based
on STRICT_ALIGNMENT would probably be more robust.  I am not sure what such a
program would look like though.  Like memcpy-3.c?  I don't think we want the
dg-effective-target routines using -fdump flags like memcpy-3.c does.


[Bug middle-end/49191] gcc.dg/memcpy-3.c FAILs on SPARC

2011-06-07 Thread ramana at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49191

--- Comment #5 from Ramana Radhakrishnan  2011-06-07 
13:13:59 UTC ---
(In reply to comment #4)
> And arm-linux-gnueabi. 

Though on ARM I would expect this to pass once we can support unaligned
memcpy's for certain versions of the architecture. 

Ramana


[Bug middle-end/49191] gcc.dg/memcpy-3.c FAILs on SPARC

2011-06-07 Thread ramana at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49191

Ramana Radhakrishnan  changed:

   What|Removed |Added

 CC||ramana at gcc dot gnu.org

--- Comment #4 from Ramana Radhakrishnan  2011-06-07 
13:12:06 UTC ---
And arm-linux-gnueabi. 

Ramana


[Bug middle-end/49191] gcc.dg/memcpy-3.c FAILs on SPARC

2011-05-28 Thread danglin at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49191

John David Anglin  changed:

   What|Removed |Added

 CC||danglin at gcc dot gnu.org

--- Comment #3 from John David Anglin  2011-05-28 
14:55:40 UTC ---
Also fails on hppa*-*-hpux*.


[Bug middle-end/49191] gcc.dg/memcpy-3.c FAILs on SPARC

2011-05-27 Thread ro at CeBiTec dot Uni-Bielefeld.DE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49191

--- Comment #2 from ro at CeBiTec dot Uni-Bielefeld.DE  2011-05-27 13:59:11 UTC ---
> Is sparc a strict-alignment target?  Then that's expected.

It is.

> Hmm.  Not sure we have a dg-effective-target strict-align ...
> so you probably have to add some xfails.

We probably should: we currently have 28 strict-alignment targets.

Rainer


[Bug middle-end/49191] gcc.dg/memcpy-3.c FAILs on SPARC

2011-05-27 Thread richard.guenther at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49191

--- Comment #1 from richard.guenther at gmail dot com  2011-05-27 13:53:57 UTC ---
On Fri, May 27, 2011 at 3:50 PM, ro at gcc dot gnu.org
 wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49191
>
>           Summary: gcc.dg/memcpy-3.c FAILs on SPARC
>           Product: gcc
>           Version: 4.7.0
>            Status: UNCONFIRMED
>          Severity: normal
>          Priority: P3
>         Component: middle-end
>        AssignedTo: unassig...@gcc.gnu.org
>        ReportedBy: r...@gcc.gnu.org
>                CC: ebotca...@gcc.gnu.org, richard.guent...@gmail.com
>              Host: sparc-sun-solaris2.*
>            Target: sparc-sun-solaris2.*
>             Build: sparc-sun-solaris2.*
>
>
> The new gcc.dg/memcpy-3.c test FAILs on Solaris/SPARC:
>
> FAIL: gcc.dg/memcpy-3.c scan-tree-dump-not optimized "memcpy"
> FAIL: gcc.dg/memcpy-3.c scan-tree-dump-times optimized "MEM" 1
>
> The dump looks like this:
>
> ;; Function get_int (get_int)
>
> get_int (const void * p)
> {
>  int w;
>  int D.1980;
>
> :
>  __builtin_memcpy (&w, p_1(D), 4);
>  D.1980_2 = w;
>  return D.1980_2;

Is sparc a strict-alignment target?  Then that's expected.

Hmm.  Not sure we have a dg-effective-target strict-align ...
so you probably have to add some xfails.