Bug 49545 - [4.6 Regression] New C++ test failures
Summary: [4.6 Regression] New C++ test failures
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: 4.6.2
Assignee: Richard Sandiford
URL:
Keywords:
Depends on:
Blocks: 49937
  Show dependency treegraph
 
Reported: 2011-06-27 13:13 UTC by H.J. Lu
Modified: 2011-08-01 20:23 UTC (History)
7 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.7.0
Known to fail:
Last reconfirmed: 2011-06-27 13:22:25


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2011-06-27 13:13:33 UTC
On Linux/x86, revision 175427:

http://gcc.gnu.org/ml/gcc-cvs/2011-06/msg00918.html

caused:

FAIL: g++.dg/cpp0x/constexpr-ptrmem.C (test for excess errors)
FAIL: g++.dg/tree-ssa/fwprop-align.C scan-tree-dump-times forwprop2 "& 1" 0
Comment 1 Richard Biener 2011-06-27 13:22:25 UTC
Ugh, I think at least g++.dg/tree-ssa/fwprop-align.C is bogus when it tries
to use alignment to compute whether a indicator bit is set ...

Anyway, confirmed.
Comment 2 Richard Biener 2011-06-27 13:36:03 UTC
An anyway useful transform would be to hoist the call in

  iftmp.0_15 = *D.2099_14;

<bb 4>:
  # iftmp.0_1 = PHI <foo(2), iftmp.0_15(3)>
  iftmp.0_1 (&a);

based on the fact that on the edge 2->4 it will be a direct call.
Comment 3 Jason Merrill 2011-06-28 06:31:11 UTC
constexpr-ptrmem.C is now failing because the C++ ABI uses the low bit of the function pointer field in a pointer-to-member function to indicate whether that field is actually a function pointer or a vtable index, and constexpr-ptrmem.C relies on being able to fold (&fn) & 1 to 0.

I assume that the ARM C++ ABI variant uses a different representation.
Comment 4 Richard Sandiford 2011-06-28 09:42:34 UTC
Sorry for the breakage.  I should obviously have tested
on x86_64-linux-gnu as well.
Comment 5 Hans-Peter Nilsson 2011-06-28 13:07:34 UTC
yup, cris-elf (non-strict-alignment) too...
Comment 6 Richard Sandiford 2011-06-29 09:42:46 UTC
Author: rsandifo
Date: Wed Jun 29 09:42:42 2011
New Revision: 175627

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175627
Log:
gcc/
	PR tree-optimization/49545
	* builtins.c (get_object_alignment_1): Update function comment.
	Do not use DECL_ALIGN for functions, but test
	TARGET_PTRMEMFUNC_VBIT_LOCATION instead.
	* fold-const.c (get_pointer_modulus_and_residue): Don't check
	for functions here.
	* tree-ssa-ccp.c (get_value_from_alignment): Likewise.

gcc/testsuite/
	* gcc.dg/torture/pr49169.c: Restrict to ARM and MIPS targets.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/builtins.c
    trunk/gcc/fold-const.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/torture/pr49169.c
    trunk/gcc/tree-ssa-ccp.c
Comment 7 Ulrich Weigand 2011-07-15 12:51:20 UTC
I'm now seeing
FAIL: g++.dg/tree-ssa/fwprop-align.C scan-tree-dump-times forwprop2 "& 1" 0
on the 4.6 branch for spu-elf ...

Could this be the same problem?
Comment 8 John David Anglin 2011-07-17 16:48:34 UTC
I'm also seeing it on hppa64-hp-hpux11.11.
Comment 9 Richard Biener 2011-07-18 08:12:50 UTC
Can you check what patch caused it on the 4.6 branch?  I suppose "fixed" on
the trunk.
Comment 10 Ulrich Weigand 2011-07-18 14:35:44 UTC
(In reply to comment #9)
> Can you check what patch caused it on the 4.6 branch?

It is this one:
http://gcc.gnu.org/ml/gcc-cvs/2011-07/msg00431.html

2011-07-11  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/49094
	* tree-sra.c (tree_non_mode_aligned_mem_p): New function.
	(build_accesses_from_assign): Use it.

> I suppose "fixed" on the trunk.

Yes, that's correct.
Comment 11 Hans-Peter Nilsson 2011-07-22 14:01:50 UTC
Looks like this got "unfixed" on trunk?
It worked on r176507, had reappeared on r176524.
Comment 12 Ulrich Weigand 2011-07-28 08:43:31 UTC
After this commit:
http://gcc.gnu.org/ml/gcc-cvs/2011-07/msg01132.html
the regression is now gone again on the 4.6 branch.

On spu-elf, this bug is now fixed both on mainline and the 4.6.
Comment 13 Hans-Peter Nilsson 2011-07-28 14:56:33 UTC
(In reply to comment #12)
> After this commit:
> http://gcc.gnu.org/ml/gcc-cvs/2011-07/msg01132.html

I.e. r176864, applied to the 4.6 branch.

Still, at r176866, g++.dg/tree-ssa/fwprop-align.C fails on trunk for cris-elf.
(For which the test never failed on the 4.6 branch.)

For cris-elf, code has to be 16-bit-aligned but otherwise there are no alignment restrictions.  Perhaps that's related to the failure.
Comment 14 Richard Biener 2011-08-01 14:39:16 UTC
Fixed.  The cris issue seems to be sth else.
Comment 15 Hans-Peter Nilsson 2011-08-01 20:16:28 UTC
(In reply to comment #14)
> Fixed.  The cris issue seems to be sth else.

Whatever, as long as it helps fixing the bug. Cloning this PR then.