[Bug middle-end/77574] Wrong if condition in predict.c

2016-09-14 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77574

Martin Liška  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Martin Liška  ---
Fixed on trunk.

[Bug middle-end/77574] Wrong if condition in predict.c

2016-09-14 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77574

--- Comment #3 from Martin Liška  ---
Author: marxin
Date: Wed Sep 14 07:18:53 2016
New Revision: 240128

URL: https://gcc.gnu.org/viewcvs?rev=240128=gcc=rev
Log:
Add braces to a condition in predict.c (PR middle-end/77574)

Martin Liska  

PR middle-end/77574
* predict.c (force_edge_cold): Add braces to a condition.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/predict.c

[Bug middle-end/77574] Wrong if condition in predict.c

2016-09-13 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77574

--- Comment #2 from Bernd Edlinger  ---
(In reply to Martin Liška from comment #1)
> Hello Bernd.
> 
> Thanks for the PR, as well the suggested patch. The patch works for me,
> I'm going to test it and submit to mailing list. Please ping me if you're
> accidentally doing the same?
> 
> Thanks,
> Martin

You are welcome.

I need to work a bit more on the warning patch,
so any help with fixing the fall-out would be appreciated.


Thanks
Bernd.

[Bug middle-end/77574] Wrong if condition in predict.c

2016-09-13 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77574

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-09-13
 Ever confirmed|0   |1

[Bug middle-end/77574] Wrong if condition in predict.c

2016-09-13 Thread mliska at suse dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77574

--- Comment #1 from Martin Liška  ---
On 09/13/2016 12:30 AM, bernd.edlinger at hotmail dot de wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77574
> 
> Bug ID: 77574
>Summary: Wrong if condition in predict.c
>Product: gcc
>Version: 7.0
> Status: UNCONFIRMED
>   Severity: normal
>   Priority: P3
>  Component: middle-end
>   Assignee: unassigned at gcc dot gnu.org
>   Reporter: bernd.edlinger at hotmail dot de
>   Target Milestone: ---
> 
> Hi,
> 
> an experimental version of my -Wint-in-bool-context patch
> found this apparently wrong code in predict.c
> 
> ../../gcc-trunk/gcc/predict.c: In function 'void force_edge_cold(edge, bool)':
> ../../gcc-trunk/gcc/predict.c:3726:36: error: ?: using integer constants in
> boolean context [-Werror=int-in-bool-context]
>if (e->probability <= impossible ? PROB_VERY_UNLIKELY : 0
>~^~~~
>&& (!impossible || !e->count))
>~ 
> 
> 
> I think it is meant this way:
>if (e->probability <= (impossible ? PROB_VERY_UNLIKELY : 0)
>&& (!impossible || !e->count))
> 

Hello Bernd.

Thanks for the PR, as well the suggested patch. The patch works for me,
I'm going to test it and submit to mailing list. Please ping me if you're
accidentally doing the same?

Thanks,
Martin