Bug 42855 - FAIL: gcc.dg/tree-ssa/pr42585.c scan-tree-dump-times optimized *
Summary: FAIL: gcc.dg/tree-ssa/pr42585.c scan-tree-dump-times optimized *
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: testsuite (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-24 16:05 UTC by Dominique d'Humieres
Modified: 2010-09-01 11:13 UTC (History)
6 users (show)

See Also:
Host: powerpc*-*-*
Target: powerpc*-*-*
Build: powerpc*-*-*
Known to work:
Known to fail:
Last reconfirmed: 2010-07-21 23:52:38


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dominique d'Humieres 2010-01-24 16:05:50 UTC
On powerpc*-*-* gcc.dg/tree-ssa/pr42585.c fails with:

FAIL: gcc.dg/tree-ssa/pr42585.c scan-tree-dump-times optimized "struct _fat_ptr _ans" 0
FAIL: gcc.dg/tree-ssa/pr42585.c scan-tree-dump-times optimized "struct _fat_ptr _T2" 0

(see http://gcc.gnu.org/ml/gcc-testresults/2010-01/msg02116.html or http://gcc.gnu.org/ml/gcc-testresults/2010-01/msg02115.html ):

[karma] f90/bug% gcc45 -c -O1 -fdump-tree-optimized /opt/gcc/gcc-4.5-work/gcc/testsuite/gcc.dg/tree-ssa/pr42585.c
[karma] f90/bug% grep struct pr42585.c.139t.optimized
Cyc_string_ungetc (int ignore, struct _fat_ptr * sptr)
  struct _fat_ptr _ans;
  struct _fat_ptr _T2;


This has probably started with

Author: jamborm
Date: Thu Jan 21 16:18:06 2010
New Revision: 156156

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=156156
Log:
2010-01-21  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/42585
	* tree-sra.c (struct access): New field grp_total_scalarization.
	(dump_access): Dump the new field.
	(should_scalarize_away_bitmap): New variable.
	(cannot_scalarize_away_bitmap): Likewise.
	(sra_initialize): Allocate new bitmaps.
	(sra_deinitialize): Free new bitmaps.
	(create_access_1): New function.
	(create_access): Parts moved to create_access_1.
	(type_consists_of_records_p): New function.
	(completely_scalarize_record): Likewise.
	(build_access_from_expr): Set bit in cannot_scalarize_away_bitmap.
	(build_accesses_from_assign): Set bits in should_scalarize_away_bitmap.
	(sort_and_splice_var_accesses): Hint groups with a total_scalarization
	access.
	(analyze_all_variable_accesses): Completely scalarize small eligible
	records.

	* testsuite/gcc.dg/tree-ssa/pr42585.c: New test.


Added:
    trunk/gcc/testsuite/gcc.dg/tree-ssa/pr42585.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-sra.c
Comment 1 Richard Biener 2010-01-24 16:58:52 UTC
It's a new test.  Probably MOVE_RATIO is not defined for your target and thus
the default of 2 applies.
Comment 2 Martin Jambor 2010-02-05 13:08:10 UTC
I wonder what to do about this.  Perhaps I should change the test to
run only on i386, x86_64 and perhaps some other enumerated platforms?
That would be enough to alert us if SRA was failing in this regard and
would not have any effect on platforms that might have their limits
set in all sorts of ways.
Comment 3 Martin Jambor 2010-03-04 14:55:49 UTC
Patch submitted to the mailing list:
http://gcc.gnu.org/ml/gcc-patches/2010-03/msg00208.html
Comment 4 Pat Haugen 2010-07-14 18:18:15 UTC
Based on the last post in the patch thread should the patch be committed so the testsuite failures go away and this can be closed?
Comment 5 Martin Jambor 2010-07-21 17:19:47 UTC
(In reply to comment #4)
> Based on the last post in the patch thread should the patch be committed so the
> testsuite failures go away and this can be closed?
> 

I do not think I got an approval to commit the patch.  I'll be happy
to cooperate with respective architecture maintainers to resolve this
issue in one way or another.  (However, this is not important enough
for me to go and actively try to force their attention this way.)
Comment 6 David Edelsohn 2010-07-21 23:52:38 UTC
I think the thread about the patch became confused.

First, Janis essentially approved the testsuite patch.

Second, Martin commented that the failure probably was due to MOVE_RATIO not defined.  The statement caused some misunderstanding.  MOVE_RATIO does not need to be defined and the failure is not caused by a missing definition.  The default value of MOVE_RATIO (used by PPC and ARM) cause the heuristic to disable the optimization being tested.

If the optimization is not expected to occur on some platforms, then the testcase should be disabled as implemented by the patch or the testcase explicitly should set some gcc param that ensures the optimization will occur on all targets.
Comment 7 Martin Jambor 2010-08-04 19:33:30 UTC
(In reply to comment #6)
> I think the thread about the patch became confused.
> 
> First, Janis essentially approved the testsuite patch.

OK, I've re-submitted the patch to the mailing list and will commit it
tomorrow if nobody objects.  Thanks.

> 
> Second, Martin commented that the failure probably was due to MOVE_RATIO not
> defined.  The statement caused some misunderstanding.  MOVE_RATIO does not need
> to be defined and the failure is not caused by a missing definition.  The
> default value of MOVE_RATIO (used by PPC and ARM) cause the heuristic to
> disable the optimization being tested.
> 
> If the optimization is not expected to occur on some platforms, then the
> testcase should be disabled as implemented by the patch or the testcase
> explicitly should set some gcc param that ensures the optimization will occur
> on all targets.
> 

Well, MOVE_RATIO defines the ratio of costs of different methods of
copying memory.  Assuming that the default value is indeed the correct
one for those platforms, it is most probably OK that SRA decides not
to totally scalarize the aggregate in the testcase in question.  But
that is really what the platform maintainers should examine (or at
least someone who knows the platforms well enough should do it).
Comment 8 Martin Jambor 2010-08-05 13:36:46 UTC
Subject: Bug 42855

Author: jamborm
Date: Thu Aug  5 13:36:18 2010
New Revision: 162913

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162913
Log:
2010-08-05  Martin Jambor  <mjambor@suse.cz>

	PR testsuite/42855
	* testsuite/gcc.dg/tree-ssa/pr42585.c: Skip dump scan on powerpc
	and arm.


Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/tree-ssa/pr42585.c

Comment 9 Martin Jambor 2010-09-01 11:13:43 UTC
Fixed.