[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug#36370: 27.0.50; XFIXNAT called on negative numbers
From: |
Bruno Haible |
Subject: |
Re: bug#36370: 27.0.50; XFIXNAT called on negative numbers |
Date: |
Fri, 28 Jun 2019 14:29:00 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-151-generic; KDE/5.18.0; x86_64; ; ) |
Oops, the test case that I meant to show is this one:
================================ foo.c =================================
#include <stdio.h>
#define assume(R) ((R) ? (void) 0 : __builtin_unreachable ())
//#define assume(R) (!__builtin_constant_p (!(R) == !(R)) || (R) ? (void) 0 :
__builtin_unreachable ())
extern int complicated (int i);
extern int nonnegative (int i);
int f_generic (int i)
{
printf("%d\n", i & 0x80000000);
return 0;
}
int f_condition (int i)
{
if (complicated (i) && nonnegative (i))
printf("%d\n", i & 0x80000000);
return 0;
}
int f_assume (int i)
{
assume (complicated (i) && nonnegative (i));
printf("%d\n", i & 0x80000000);
return 0;
}
================================ bar.c =================================
int complicated (int i) { return (i & 7) == 3; }
int nonnegative (int i) { return i >= 0; }
========================================================================
The results are as shown: the optimization in f_assume is performed
with the old 'assume' definition, but not with the new one.
- Re: bug#36370: 27.0.50; XFIXNAT called on negative numbers, Paul Eggert, 2019/06/27
- Re: bug#36370: 27.0.50; XFIXNAT called on negative numbers, Bruno Haible, 2019/06/27
- Re: bug#36370: 27.0.50; XFIXNAT called on negative numbers, Paul Eggert, 2019/06/27
- Re: bug#36370: 27.0.50; XFIXNAT called on negative numbers, Pip Cet, 2019/06/28
- Re: bug#36370: 27.0.50; XFIXNAT called on negative numbers, Bruno Haible, 2019/06/28
- Re: bug#36370: 27.0.50; XFIXNAT called on negative numbers,
Bruno Haible <=
- Re: bug#36370: 27.0.50; XFIXNAT called on negative numbers, Pip Cet, 2019/06/28
- Re: bug#36370: 27.0.50; XFIXNAT called on negative numbers, Paul Eggert, 2019/06/28
- Re: bug#36370: 27.0.50; XFIXNAT called on negative numbers, Pip Cet, 2019/06/28
- Re: bug#36370: 27.0.50; XFIXNAT called on negative numbers, Bruno Haible, 2019/06/28
- Re: bug#36370: 27.0.50; XFIXNAT called on negative numbers, Pip Cet, 2019/06/28
- Re: bug#36370: 27.0.50; XFIXNAT called on negative numbers, Paul Eggert, 2019/06/29
- Re: bug#36370: 27.0.50; XFIXNAT called on negative numbers, Pip Cet, 2019/06/29
- Re: bug#36370: 27.0.50; XFIXNAT called on negative numbers, Paul Eggert, 2019/06/29
- Re: bug#36370: 27.0.50; XFIXNAT called on negative numbers, Pip Cet, 2019/06/30
- Re: bug#36370: 27.0.50; XFIXNAT called on negative numbers, Bruno Haible, 2019/06/28