Bug 22525 - tree based value profiling (-fprofile-use) produces mismatch types in conditional
Summary: tree based value profiling (-fprofile-use) produces mismatch types in conditi...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.2.0
Assignee: Richard Biener
URL:
Keywords:
Depends on:
Blocks: 22368
  Show dependency treegraph
 
Reported: 2005-07-17 17:06 UTC by Andrew Pinski
Modified: 2006-04-26 07:59 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-04-19 08:39:25


Attachments
patch which I need to test (from Honza) (387 bytes, patch)
2005-07-17 17:53 UTC, Andrew Pinski
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2005-07-17 17:06:30 UTC
The testcase is gcc.dg/tree-prof/val-prof-2.c.  It only happens when profile use is used.
Note this is worse if we use unsigned long long instead as we get a size mismatch.
See PR 22368 for the patch to catch this (the second patch):

/Users/pinskia/src/local/gcc/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c: In function 'main':^M
/Users/pinskia/src/local/gcc/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c:25: error: types mismatch in 
comparsion^M
unsigned intD.3^M
intD.0^M
PROF.4D.1300 != 0;^M
^M
/Users/pinskia/src/local/gcc/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c:25: internal compiler error: 
verify_stmts failed^M
Please submit a full bug report,^M
with preprocessed source if appropriate.^M
See <URL:http://gcc.gnu.org/bugs.html> for instructions.^M
Comment 1 Andrew Pinski 2005-07-17 17:53:59 UTC
Created attachment 9295 [details]
patch which I need to test (from Honza)
Comment 2 Andrew Pinski 2005-08-08 03:18:05 UTC
Confirmed, will test the patch now.
Comment 3 Andrew Pinski 2005-08-08 12:31:43 UTC
And yes the patch fixes the bug.
Comment 4 Richard Biener 2006-04-19 08:39:25 UTC
I have a patch (and found this bug "too late").
Comment 5 Richard Biener 2006-04-24 07:58:58 UTC
Subject: Bug 22525

Author: rguenth
Date: Mon Apr 24 07:58:53 2006
New Revision: 113216

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113216
Log:
2006-04-24  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/22525
	* value-prof.c (tree_mod_pow2): Remove unnecessary temporary
	variable, adjust types of generated expressions.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/value-prof.c

Comment 6 Richard Biener 2006-04-24 08:36:00 UTC
Fixed.
Comment 7 Brett Albertson 2006-04-25 19:29:04 UTC
(In reply to comment #6)
> Fixed.
> 

After this patch was applied onto trunk, the following test started failing on Solaris x86:

FAIL: gcc.dg/tree-prof/val-prof-2.c scan-tree-dump n \+ \-1

All the other val-prof-2.c tests PASS.  Any ideas?

Brett Albertson
Comment 8 Richard Biener 2006-04-26 07:59:50 UTC
Sorry, I fixed that in a followup.  -1 is now unsigned and so appears as n + fffffffffff.