public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors
@ 2012-04-16  3:16 jjcogliati-r1 at yahoo dot com
  2012-04-16 11:41 ` [Bug c/53001] " manu at gcc dot gnu.org
                   ` (25 more replies)
  0 siblings, 26 replies; 27+ messages in thread
From: jjcogliati-r1 at yahoo dot com @ 2012-04-16  3:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

             Bug #: 53001
           Summary: -Wfloat-conversion should be available to warn about
                    floating point errors
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jjcogliati-r1@yahoo.com


This is a request to add a new warning that warns on the subset of -Wconversion
warnings that involve floating point numbers.  For example, with
-Wfloat-conversion this would cause a warning:

int main(int argc, char ** argv) {
  int i = 3.14;
  return i;
}

I think this could mostly be done by modifying gcc/c-family/c-common.c
unsafe_conversion_p to add the ability to only warn on conversions where
REAL_TYPE or REAL_CST are involved.  

The reason -Wconversion is not sufficient is that using it can cause hundreds
of warnings, almost all of which are integer size warnings (many of which are
in libraries (such as libMesh)).  I would like to be able to enable something
like -Wfloat-conversion that would catch errors involving floating point number
conversions, while ignoring the integer size conversions.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
@ 2012-04-16 11:41 ` manu at gcc dot gnu.org
  2012-04-16 12:17 ` jjcogliati-r1 at yahoo dot com
                   ` (24 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: manu at gcc dot gnu.org @ 2012-04-16 11:41 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-04-16 11:41:24 UTC ---
(In reply to comment #0)
> This is a request to add a new warning that warns on the subset of -Wconversion
> warnings that involve floating point numbers.  For example, with
> -Wfloat-conversion this would cause a warning:

Should it also warn for non-literals?

int foo(double x)
{
   return x;
}

> I think this could mostly be done by modifying gcc/c-family/c-common.c
> unsafe_conversion_p to add the ability to only warn on conversions where
> REAL_TYPE or REAL_CST are involved.  

Yes, I think it should be easy to implement. You will also need to add a new
option to gcc/c.opt and enable -Wfloat-conversion with -Wconversion (grep for
OPT_Wimplict and how it handles its suboptions).

Unfortunately, I don't have time to work on this, and probably nobody else has,
so you could try to submit a patch: http://gcc.gnu.org/contribute.html


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
  2012-04-16 11:41 ` [Bug c/53001] " manu at gcc dot gnu.org
@ 2012-04-16 12:17 ` jjcogliati-r1 at yahoo dot com
  2012-04-16 12:37 ` manu at gcc dot gnu.org
                   ` (23 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jjcogliati-r1 at yahoo dot com @ 2012-04-16 12:17 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

--- Comment #2 from Joshua Cogliati <jjcogliati-r1 at yahoo dot com> 2012-04-16 12:16:45 UTC ---
Yes, it should also warn for non-constants, and also for other floating
decreases in accuracy such as: 

float foo(double x) {
  return x;
}

I should have time to create a patch for this before 4.8 goes into stage 3.  Do
you think it needs a copyright assignment and if so what paperwork would you
need from my employer?


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
  2012-04-16 11:41 ` [Bug c/53001] " manu at gcc dot gnu.org
  2012-04-16 12:17 ` jjcogliati-r1 at yahoo dot com
@ 2012-04-16 12:37 ` manu at gcc dot gnu.org
  2012-06-07 14:04 ` manu at gcc dot gnu.org
                   ` (22 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: manu at gcc dot gnu.org @ 2012-04-16 12:37 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

--- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-04-16 12:36:59 UTC ---
(In reply to comment #2)
> I should have time to create a patch for this before 4.8 goes into stage 3.  Do
> you think it needs a copyright assignment and if so what paperwork would you
> need from my employer?

I am afraid so. See:
https://www.gnu.org/prep/maintain/maintain.html#Legal-Matters

Write to gcc@gcc.gnu.org asking for the documents. There are several people
there dealing with this matter. Also, let us know if you find any problems.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (2 preceding siblings ...)
  2012-04-16 12:37 ` manu at gcc dot gnu.org
@ 2012-06-07 14:04 ` manu at gcc dot gnu.org
  2012-06-22 12:29 ` jjcogliati-r1 at yahoo dot com
                   ` (21 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: manu at gcc dot gnu.org @ 2012-06-07 14:04 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gcc at richardneill dot org

--- Comment #4 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-06-07 14:03:45 UTC ---
*** Bug 53603 has been marked as a duplicate of this bug. ***


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (3 preceding siblings ...)
  2012-06-07 14:04 ` manu at gcc dot gnu.org
@ 2012-06-22 12:29 ` jjcogliati-r1 at yahoo dot com
  2012-06-22 12:41 ` manu at gcc dot gnu.org
                   ` (20 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jjcogliati-r1 at yahoo dot com @ 2012-06-22 12:29 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

--- Comment #5 from Joshua Cogliati <jjcogliati-r1 at yahoo dot com> 2012-06-22 12:29:14 UTC ---
(In reply to comment #3)
> (In reply to comment #2)
> > I should have time to create a patch for this before 4.8 goes into stage 3.  Do
> > you think it needs a copyright assignment and if so what paperwork would you
> > need from my employer?
> 
> I am afraid so. See:
> https://www.gnu.org/prep/maintain/maintain.html#Legal-Matters
> 
> Write to gcc@gcc.gnu.org asking for the documents. There are several people
> there dealing with this matter. Also, let us know if you find any problems.

I have written to to gcc@gcc.gnu.org, and submitted the Employer disclaimer to
my employer, but my employer is reluctant to sign it. I may not be able to
create the patch because of that.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (4 preceding siblings ...)
  2012-06-22 12:29 ` jjcogliati-r1 at yahoo dot com
@ 2012-06-22 12:41 ` manu at gcc dot gnu.org
  2013-09-02 19:50 ` jjcogliati-r1 at yahoo dot com
                   ` (19 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: manu at gcc dot gnu.org @ 2012-06-22 12:41 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

--- Comment #6 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-06-22 12:41:05 UTC ---
(In reply to comment #5)
> 
> I have written to to gcc@gcc.gnu.org, and submitted the Employer disclaimer to
> my employer, but my employer is reluctant to sign it. I may not be able to
> create the patch because of that.

Write to both gcc@gcc.gnu.org and assign@gnu.org to explain your case. They may
be able to work out an arrangement. Sadly, this situation is fairly common.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (5 preceding siblings ...)
  2012-06-22 12:41 ` manu at gcc dot gnu.org
@ 2013-09-02 19:50 ` jjcogliati-r1 at yahoo dot com
  2013-09-20 16:27 ` jjcogliati-r1 at yahoo dot com
                   ` (18 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jjcogliati-r1 at yahoo dot com @ 2013-09-02 19:50 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

--- Comment #7 from Joshua Cogliati <jjcogliati-r1 at yahoo dot com> ---
I wrote the patch for 4.8.1 (which is the easy part), now I will see if I can
get approval to submit it through the bureaucracies (the hard part).


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (6 preceding siblings ...)
  2013-09-02 19:50 ` jjcogliati-r1 at yahoo dot com
@ 2013-09-20 16:27 ` jjcogliati-r1 at yahoo dot com
  2013-09-20 16:30 ` jjcogliati-r1 at yahoo dot com
                   ` (17 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jjcogliati-r1 at yahoo dot com @ 2013-09-20 16:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

Joshua Cogliati <jjcogliati-r1 at yahoo dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jjcogliati-r1 at yahoo dot com

--- Comment #8 from Joshua Cogliati <jjcogliati-r1 at yahoo dot com> ---
Created attachment 30870
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30870&action=edit
Patch to add -Wfloat-conversion option

This patch add a -Wfloat-conversion option.  It adds an enumeration type called
conversion_safety, with a SAFE_CONVERSION being 0, and unsafe ones being
non-zero.  It changes the unsafe_conversion_p to return this enumeration.  This
allows the floating point conversions to be handled separately.  

Someone who understands the c.opt file better than I should check that I did it
correctly. 

-Wconversion implies -Wfloat-conversion.   -Wall does not, but it might
possibly be worth considering.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (7 preceding siblings ...)
  2013-09-20 16:27 ` jjcogliati-r1 at yahoo dot com
@ 2013-09-20 16:30 ` jjcogliati-r1 at yahoo dot com
  2013-09-20 16:39 ` gcc at richardneill dot org
                   ` (16 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jjcogliati-r1 at yahoo dot com @ 2013-09-20 16:30 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

--- Comment #9 from Joshua Cogliati <jjcogliati-r1 at yahoo dot com> ---
Created attachment 30871
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30871&action=edit
some floating conversion issues

This tests three of the floating conversion reduction in precision issues.  

P.S. Copyright assignment paperwork from both myself and my employer for GCC
has been sent to copyright-clerk


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (8 preceding siblings ...)
  2013-09-20 16:30 ` jjcogliati-r1 at yahoo dot com
@ 2013-09-20 16:39 ` gcc at richardneill dot org
  2013-09-20 17:27 ` jjcogliati-r1 at yahoo dot com
                   ` (15 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: gcc at richardneill dot org @ 2013-09-20 16:39 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

--- Comment #10 from Richard Neill <gcc at richardneill dot org> ---
Thank you for adding this - I will certainly find it useful!

May I suggest that this warning be implicitly enabled by -Wextra, (even if it's
not enabled by -Wall) ?


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (9 preceding siblings ...)
  2013-09-20 16:39 ` gcc at richardneill dot org
@ 2013-09-20 17:27 ` jjcogliati-r1 at yahoo dot com
  2013-09-20 20:27 ` manu at gcc dot gnu.org
                   ` (14 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jjcogliati-r1 at yahoo dot com @ 2013-09-20 17:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

--- Comment #11 from Joshua Cogliati <jjcogliati-r1 at yahoo dot com> ---
Created attachment 30873
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30873&action=edit
Patch to add -Wfloat-conversion option

This version also is enabled with -Wextra.  

$ gcc -o float_test float_test.c
$ gcc -Wfloat-conversion -o float_test float_test.c
float_test.c: In function ‘main’:
float_test.c:2:3: warning: conversion to ‘int’ alters ‘double’ constant value
[-Wfloat-conversion]
   int i = 3.14;
   ^
float_test.c: In function ‘foo’:
float_test.c:8:3: warning: conversion to ‘int’ from ‘double’ may alter its
value [-Wfloat-conversion]
   return x;
   ^
float_test.c: In function ‘foo2’:
float_test.c:12:3: warning: conversion to ‘float’ from ‘double’ may alter its
value [-Wfloat-conversion]
   return x;
   ^
$ gcc -Wconversion -o float_test float_test.c
float_test.c: In function ‘main’:
float_test.c:2:3: warning: conversion to ‘int’ alters ‘double’ constant value
[-Wfloat-conversion]
   int i = 3.14;
   ^
float_test.c: In function ‘foo’:
float_test.c:8:3: warning: conversion to ‘int’ from ‘double’ may alter its
value [-Wfloat-conversion]
   return x;
   ^
float_test.c: In function ‘foo2’:
float_test.c:12:3: warning: conversion to ‘float’ from ‘double’ may alter its
value [-Wfloat-conversion]
   return x;
   ^
$ gcc -Wextra -o float_test float_test.c
float_test.c: In function ‘main’:
float_test.c:2:3: warning: conversion to ‘int’ alters ‘double’ constant value
[-Wfloat-conversion]
   int i = 3.14;
   ^
float_test.c: In function ‘foo’:
float_test.c:8:3: warning: conversion to ‘int’ from ‘double’ may alter its
value [-Wfloat-conversion]
   return x;
   ^
float_test.c: In function ‘foo2’:
float_test.c:12:3: warning: conversion to ‘float’ from ‘double’ may alter its
value [-Wfloat-conversion]
   return x;
   ^
>From gcc-bugs-return-430300-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Sep 20 17:41:21 2013
Return-Path: <gcc-bugs-return-430300-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23676 invoked by alias); 20 Sep 2013 17:41:20 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 23611 invoked by uid 55); 20 Sep 2013 17:41:17 -0000
From: "oleg at smolsky dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/58465] TSan deadlock in a single-threaded program
Date: Fri, 20 Sep 2013 17:41:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: sanitizer
X-Bugzilla-Version: 4.8.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: major
X-Bugzilla-Who: oleg at smolsky dot net
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-58465-4-m5oZoqbjdD@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58465-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58465-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-09/txt/msg01540.txt.bz2
Content-length: 2162

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX465

--- Comment #5 from Oleg Smolsky <oleg at smolsky dot net> ---
BTW, I get an identical deadlock with ASan:

#0  0x00007fe631504ae9 in syscall () from /lib64/libc.so.6
#1  0x00007fe63363ddc0 in __sanitizer::internal_sched_yield ()
     at
../../../../gcc48-google/libsanitizer/sanitizer_common/sanitizer_linux.cc:138
#2  0x00007fe63362d521 in __sanitizer::StaticSpinMutex::LockSlow
(this=this@entry=0x7fe635bb29c0 <__sanitizer::depot>)
     at
../../../../gcc48-google/libsanitizer/sanitizer_common/sanitizer_mutex.h:49
#3  0x00007fe63363fef4 in Lock (this=0x7fe635bb29c0 <__sanitizer::depot>)
     at
../../../../gcc48-google/libsanitizer/sanitizer_common/sanitizer_mutex.h:30
#4  GenericScopedLock (mu=0x7fe635bb29c0 <__sanitizer::depot>,
this=<synthetic pointer>)
     at
../../../../gcc48-google/libsanitizer/sanitizer_common/sanitizer_mutex.h:83
#5  allocDesc (size=2) at
../../../../gcc48-google/libsanitizer/sanitizer_common/sanitizer_stackdepot.cc:90
#6  __sanitizer::StackDepotPut (stack=stack@entry=0x7fff79d77100, size=2)
     at
../../../../gcc48-google/libsanitizer/sanitizer_common/sanitizer_stackdepot.cc:169
#7  0x00007fe63362c3c0 in __asan::Allocate (size=size@entryI,
alignment=<optimized out>, alignment@entry=8,
     stack=stack@entry=0x7fff79d770f0,
alloc_type=alloc_type@entry=__asan::FROM_MALLOC)
     at ../../../../gcc48-google/libsanitizer/asan/asan_allocator2.cc:386
#8  0x00007fe63362cf02 in __asan::asan_malloc (size=size@entryI,
stack=stack@entry=0x7fff79d770f0)
     at ../../../../gcc48-google/libsanitizer/asan/asan_allocator2.cc:599
#9  0x00007fe633638fa3 in __interceptor_malloc (sizeI)
     at ../../../../gcc48-google/libsanitizer/asan/asan_malloc_linux.cc:72
#10 0x00007fe63144fdb9 in _nl_make_l10nflist () from /lib64/libc.so.6
#11 0x00007fe63144e0c5 in _nl_find_domain () from /lib64/libc.so.6
#12 0x00007fe63144d9b0 in __dcigettext () from /lib64/libc.so.6
#13 0x00007fe6314a0a38 in strerror_r () from /lib64/libc.so.6
#14 0x00007fe6314a093e in strerror () from /lib64/libc.so.6
#15 0x00007fe63362ef42 in __interceptor_strerror (errnum=<optimized out>)


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (10 preceding siblings ...)
  2013-09-20 17:27 ` jjcogliati-r1 at yahoo dot com
@ 2013-09-20 20:27 ` manu at gcc dot gnu.org
  2013-09-21  0:25 ` jjcogliati-r1 at yahoo dot com
                   ` (13 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: manu at gcc dot gnu.org @ 2013-09-20 20:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

--- Comment #12 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
The patch looks mostly correct to me, but you will need a few extra details
before a maintainer (not me!) can accept it. 

* You need to bootstrap + run the testsuite. You don't really need to add
testcases, because there are quite a few already in the testsuite for
Wconversion, but perhaps to be sure that your patch is correct, you could check
those and change -Wconversion for -Wfloat-conversion where it should trigger.

* You need to write a Changelog and submit to gcc-patches@gcc.gnu.org. When
submitting CC dodji@redhat.com who is the diagnostics maintainer.

* There are some potential issues in the patch that maintainers may complain 

diff -ur gcc-4.8.1_orig/gcc/c-family/c-common.c
gcc-4.8.1/gcc/c-family/c-common.c
--- gcc-4.8.1_orig/gcc/c-family/c-common.c    2013-05-14 14:52:27.000000000
-0600
+++ gcc-4.8.1/gcc/c-family/c-common.c    2013-09-02 13:14:01.000000000 -0600
@@ -294,6 +294,8 @@
   {NULL, 0, 0},
 };

+enum conversion_safety
{SAFE_CONVERSION=0,UNSAFE_OTHER,UNSAFE_SIGN,UNSAFE_REAL};
+

Perhaps you should add a bit of documentation of what each value means? Also,
you don't seem to use UNSAFE_SIGN.
Also, some extra whitespace around =, after ',' and {,  and before }.

-extern bool unsafe_conversion_p (tree, tree, bool);

This function is used in the C++ FE, you cannot make it static. Did you
bootstrap the compiler with the patch?

+      if ((conversion_kind = unsafe_conversion_p (type, expr, true)))

I don't think this is going to be accepted. You should split the assignment and
the test.

+Wfloat-conversion
+C ObjC C++ ObjC++ Var(warn_float_conversion) LangEnabledBy(C ObjC
C++,Wconversion) EnabledBy(Wextra)

This looks ok to me, but you could add ObjC++ in the LangEnabledBy part.

+This includes conversions from real to integer, and from higher precision
+real to lower precision real values.  This option is also enabled by 
+@option{-Wconversion}.

and by @option{-Wextra}! You should also add it to the list of things enabled
by -Wextra (look where -Wextra is defined).
>From gcc-bugs-return-430319-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Sep 20 20:33:08 2013
Return-Path: <gcc-bugs-return-430319-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 3282 invoked by alias); 20 Sep 2013 20:33:08 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 3230 invoked by uid 48); 20 Sep 2013 20:33:05 -0000
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
Date: Fri, 20 Sep 2013 20:33:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: manu at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-53001-4-vcbsTVoEEa@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-53001-4@http.gcc.gnu.org/bugzilla/>
References: <bug-53001-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-09/txt/msg01559.txt.bz2
Content-length: 377

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

--- Comment #13 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
Another potential issue is that your patch is against 4.8.1, but this is not a
regression, so it is very likely that maintainers will ask you to submit a
patch with respect to current trunk: http://www.gnu.org/software/gcc/svn.html
>From gcc-bugs-return-430320-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Sep 20 20:46:10 2013
Return-Path: <gcc-bugs-return-430320-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 10618 invoked by alias); 20 Sep 2013 20:46:10 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 10584 invoked by uid 48); 20 Sep 2013 20:46:08 -0000
From: "glisse at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/58487] Missed return value optimization
Date: Fri, 20 Sep 2013 20:46:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.8.1
X-Bugzilla-Keywords: missed-optimization
X-Bugzilla-Severity: normal
X-Bugzilla-Who: glisse at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: keywords
Message-ID: <bug-58487-4-865XOCA9kQ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58487-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58487-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-09/txt/msg01560.txt.bz2
Content-length: 429

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX487

Marc Glisse <glisse at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization

--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
PR53637 or one of the other RVO PRs (see the meta PR 58055).


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (11 preceding siblings ...)
  2013-09-20 20:27 ` manu at gcc dot gnu.org
@ 2013-09-21  0:25 ` jjcogliati-r1 at yahoo dot com
  2013-09-22 23:02 ` jjcogliati-r1 at yahoo dot com
                   ` (12 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jjcogliati-r1 at yahoo dot com @ 2013-09-21  0:25 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

--- Comment #14 from Joshua Cogliati <jjcogliati-r1 at yahoo dot com> ---
Manuel López-Ibáñez, thank you for the patch review.  I will make the changes
you requested, and rebase it against svn trunk, and run bootstrap and
testsuite.  It may be a few weeks before I get this all done (depending on
available time).

UNSAFE_SIGN is unused, but when I was doing the patch, I noticed that
unsafe_conversion_p basically does not report sign conversion errors, instead
it does the warning directly inside the function.  So there definitely is a
distinct unsafe conversion type, but I am not sure if I should remove the
constant entirely or not.  Either way I will try and document the behavior
better.
>From gcc-bugs-return-430334-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Sep 21 05:51:59 2013
Return-Path: <gcc-bugs-return-430334-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 21680 invoked by alias); 21 Sep 2013 05:51:58 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 21648 invoked by uid 48); 21 Sep 2013 05:51:55 -0000
From: "gang.chen at asianux dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/58256] gcc for h8300  internal compiler error: in maybe_record_trace_start
Date: Sat, 21 Sep 2013 05:51:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: gang.chen at asianux dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-58256-4-NMPjeDOzTv@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58256-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58256-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-09/txt/msg01574.txt.bz2
Content-length: 555

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX256

--- Comment #12 from Chen Gang <gang.chen at asianux dot com> ---
I am just comparing the issue code demo and the other 3 correct code demo (the
demostrations which del one param, or add one param, or add two params are all
correct).

I find the issue code contents additonal one 'code_label' insn in its rtx tree,
before create trace.

I will continue analyzing, it seems, by comparing the issue demo and the other
3 correct demo, and dumping related information step by step, can find the root
cause.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (12 preceding siblings ...)
  2013-09-21  0:25 ` jjcogliati-r1 at yahoo dot com
@ 2013-09-22 23:02 ` jjcogliati-r1 at yahoo dot com
  2013-09-26  3:32 ` jjcogliati-r1 at yahoo dot com
                   ` (11 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jjcogliati-r1 at yahoo dot com @ 2013-09-22 23:02 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

Joshua Cogliati <jjcogliati-r1 at yahoo dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #30870|0                           |1
        is obsolete|                            |
  Attachment #30871|0                           |1
        is obsolete|                            |

--- Comment #15 from Joshua Cogliati <jjcogliati-r1 at yahoo dot com> ---
Created attachment 30882
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30882&action=edit
Patch to add -Wfloat-conversion option

Adding documentation, formating better, removing assignment from test.  Still
based on 4.8.1 (which will be fixed later)

Still a static function, C++ seems to be bootstraped fine.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (13 preceding siblings ...)
  2013-09-22 23:02 ` jjcogliati-r1 at yahoo dot com
@ 2013-09-26  3:32 ` jjcogliati-r1 at yahoo dot com
  2013-09-26 11:50 ` manu at gcc dot gnu.org
                   ` (10 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jjcogliati-r1 at yahoo dot com @ 2013-09-26  3:32 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

Joshua Cogliati <jjcogliati-r1 at yahoo dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #30873|0                           |1
        is obsolete|                            |

--- Comment #16 from Joshua Cogliati <jjcogliati-r1 at yahoo dot com> ---
Created attachment 30899
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30899&action=edit
Patch to add -Wfloat-conversion option against trunk

This version is against gcc trunk (rev 202818).  For trunk, I had to unmake
unsafe_conversion_p being static (it is now extern again.)  

This does not bootstrap trunk yet, because gcc has floating conversion issues
and with this being enabled by -Wextra and with -Werror, gcc fails to build.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (14 preceding siblings ...)
  2013-09-26  3:32 ` jjcogliati-r1 at yahoo dot com
@ 2013-09-26 11:50 ` manu at gcc dot gnu.org
  2013-09-27 12:06 ` jjcogliati-r1 at yahoo dot com
                   ` (9 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: manu at gcc dot gnu.org @ 2013-09-26 11:50 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

--- Comment #17 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Joshua Cogliati from comment #16)
> This does not bootstrap trunk yet, because gcc has floating conversion
> issues and with this being enabled by -Wextra and with -Werror, gcc fails to
> build.

Are those real bugs or normal code?
>From gcc-bugs-return-430598-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Sep 26 12:45:26 2013
Return-Path: <gcc-bugs-return-430598-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 5438 invoked by alias); 26 Sep 2013 12:45:25 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 5376 invoked by uid 55); 26 Sep 2013 12:45:22 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/58539] [4.7/4.8/4.9 Regression] ICE with segfault at -O3 with -g enabled on x86_64-linux-gnu
Date: Thu, 26 Sep 2013 12:45:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-58539-4-GZd6laoPCx@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58539-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58539-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-09/txt/msg01838.txt.bz2
Content-length: 695

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX539

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Thu Sep 26 12:45:19 2013
New Revision: 202942

URL: http://gcc.gnu.org/viewcvs?rev 2942&root=gcc&view=rev
Log:
2013-09-26  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/58539
    * tree-vect-loop.c (vect_create_epilog_for_reduction): Honor
    the fact that debug statements are not taking part in loop-closed
    SSA construction.

    * gcc.dg/torture/pr58539.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr58539.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-loop.c


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (15 preceding siblings ...)
  2013-09-26 11:50 ` manu at gcc dot gnu.org
@ 2013-09-27 12:06 ` jjcogliati-r1 at yahoo dot com
  2013-09-30 12:13 ` jjcogliati-r1 at yahoo dot com
                   ` (8 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jjcogliati-r1 at yahoo dot com @ 2013-09-27 12:06 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

--- Comment #19 from Joshua Cogliati <jjcogliati-r1 at yahoo dot com> ---
Created attachment 30913
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30913&action=edit
Patch to add -Wfloat-conversion option against trunk

This version is against gcc trunk (rev 202818).  It now bootstraps.  

It adds about ten casts so that the existing float conversions in gcc are now
explicit instead of implicit so that gcc can bootstrap even with the new
warning.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (16 preceding siblings ...)
  2013-09-27 12:06 ` jjcogliati-r1 at yahoo dot com
@ 2013-09-30 12:13 ` jjcogliati-r1 at yahoo dot com
  2013-10-11  2:23 ` jjcogliati-r1 at yahoo dot com
                   ` (7 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jjcogliati-r1 at yahoo dot com @ 2013-09-30 12:13 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

Joshua Cogliati <jjcogliati-r1 at yahoo dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #30913|0                           |1
        is obsolete|                            |

--- Comment #20 from Joshua Cogliati <jjcogliati-r1 at yahoo dot com> ---
Created attachment 30937
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30937&action=edit
Patch to add -Wfloat-conversion option against trunk

Added one more changed needed to get it to compile (which only occured if I did
an rm -Rf in the build directry, the make bootstrap didn't catch the libcpp
warning found.)  

The only thing I have left is to possibly modify the test scripts (to use
-Wfloat-conversion instead of -Wconversion for the relevant tests) and
recompile against the current trunk.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (17 preceding siblings ...)
  2013-09-30 12:13 ` jjcogliati-r1 at yahoo dot com
@ 2013-10-11  2:23 ` jjcogliati-r1 at yahoo dot com
  2013-10-11  2:31 ` jjcogliati-r1 at yahoo dot com
                   ` (6 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jjcogliati-r1 at yahoo dot com @ 2013-10-11  2:23 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

Joshua Cogliati <jjcogliati-r1 at yahoo dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #30899|0                           |1
        is obsolete|                            |

--- Comment #22 from Joshua Cogliati <jjcogliati-r1 at yahoo dot com> ---
Created attachment 30979
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30979&action=edit
Patch to add -Wfloat-conversion option against trunk

This version only does the -Wfloat-conversion.  It does not do the -Wextra or
the changes needed to get -Wextra to bootstrap.  It starts to change the test
cases.  This work is to satisfy the request on the gcc-patch list.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (18 preceding siblings ...)
  2013-10-11  2:23 ` jjcogliati-r1 at yahoo dot com
@ 2013-10-11  2:31 ` jjcogliati-r1 at yahoo dot com
  2013-10-13 13:48 ` jjcogliati-r1 at yahoo dot com
                   ` (5 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jjcogliati-r1 at yahoo dot com @ 2013-10-11  2:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

--- Comment #23 from Joshua Cogliati <jjcogliati-r1 at yahoo dot com> ---
Created attachment 30980
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30980&action=edit
Patch to fixup gcc float conversions in GCC

This changes the float conversions in gcc so that gcc bootstraps if float
conversions are warned about with -Wextra.  Splitting the patch was requested
on gcc-patches.


(Note to self: patches were created with 
svn diff --diff-cmd diff -x -up
)


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (19 preceding siblings ...)
  2013-10-11  2:31 ` jjcogliati-r1 at yahoo dot com
@ 2013-10-13 13:48 ` jjcogliati-r1 at yahoo dot com
  2013-10-16  2:48 ` jjcogliati-r1 at yahoo dot com
                   ` (4 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jjcogliati-r1 at yahoo dot com @ 2013-10-13 13:48 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

Joshua Cogliati <jjcogliati-r1 at yahoo dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #30979|0                           |1
        is obsolete|                            |

--- Comment #24 from Joshua Cogliati <jjcogliati-r1 at yahoo dot com> ---
Created attachment 30994
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30994&action=edit
Patch to add -Wfloat-conversion option against trunk with testcases

This version modifies a few more testcases.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (20 preceding siblings ...)
  2013-10-13 13:48 ` jjcogliati-r1 at yahoo dot com
@ 2013-10-16  2:48 ` jjcogliati-r1 at yahoo dot com
  2013-10-22  1:37 ` jjcogliati-r1 at yahoo dot com
                   ` (3 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jjcogliati-r1 at yahoo dot com @ 2013-10-16  2:48 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

Joshua Cogliati <jjcogliati-r1 at yahoo dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #30994|0                           |1
        is obsolete|                            |

--- Comment #25 from Joshua Cogliati <jjcogliati-r1 at yahoo dot com> ---
Created attachment 31014
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31014&action=edit
Patch to add -Wfloat-conversion option against trunk with testcases

Changes some formatting and comments as requested on mailing list.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (21 preceding siblings ...)
  2013-10-16  2:48 ` jjcogliati-r1 at yahoo dot com
@ 2013-10-22  1:37 ` jjcogliati-r1 at yahoo dot com
  2013-11-20  7:15 ` manu at gcc dot gnu.org
                   ` (2 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jjcogliati-r1 at yahoo dot com @ 2013-10-22  1:37 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

--- Comment #26 from Joshua Cogliati <jjcogliati-r1 at yahoo dot com> ---
Created attachment 31065
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31065&action=edit
Patch to add -Wfloat-conversion option against trunk with new testcase

This adds a new testcase instead of using existing testcases.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (22 preceding siblings ...)
  2013-10-22  1:37 ` jjcogliati-r1 at yahoo dot com
@ 2013-11-20  7:15 ` manu at gcc dot gnu.org
  2013-11-20  7:42 ` manu at gcc dot gnu.org
  2013-11-22 13:10 ` jjcogliati-r1 at yahoo dot com
  25 siblings, 0 replies; 27+ messages in thread
From: manu at gcc dot gnu.org @ 2013-11-20  7:15 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

--- Comment #28 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
Author: manu
Date: Wed Nov 20 07:15:40 2013
New Revision: 205090

URL: http://gcc.gnu.org/viewcvs?rev=205090&root=gcc&view=rev
Log:
2013-11-19  Joshua J Cogliati  <jrincayc@yahoo.com>

    PR c/53001
    Splitting out a -Wfloat-conversion from -Wconversion for
    conversions that lower floating point number precision
    or conversion from floating point numbers to integers.

gcc/c-family/

    * c-common.c (unsafe_conversion_p): Make this function
    return an enumeration with more detail.
    (conversion_warning): Use the new return type of
    unsafe_conversion_p to separately warn either about conversions
    that lower floating point number precision or about the other
    kinds of conversions.
     * c-common.h (enum conversion_safety): New enumeration.
     (unsafe_conversion_p): switching return type to
     conversion_safety enumeration.
    * c.opt: Adding new warning -Wfloat-conversion and
    enabling it with -Wconversion.

gcc/

    * doc/invoke.texi: Adding documentation about
    -Wfloat-conversion.

gcc/testsuite/

    * c-c++-common/Wfloat-conversion.c: Copies relevant
    tests from c-c++-common/Wconversion-real.c,
    gcc.dg/Wconversion-real-integer.c and gcc.dg/pr35635.c into
    new testcase for conversions that are warned about by
    -Wfloat-conversion.

Added:
    trunk/gcc/testsuite/c-c++-common/Wfloat-conversion.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-common.c
    trunk/gcc/c-family/c-common.h
    trunk/gcc/c-family/c.opt
    trunk/gcc/doc/invoke.texi
    trunk/gcc/testsuite/ChangeLog
>From gcc-bugs-return-435172-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Nov 20 07:23:51 2013
Return-Path: <gcc-bugs-return-435172-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 16025 invoked by alias); 20 Nov 2013 07:23:51 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 15967 invoked by uid 55); 20 Nov 2013 07:23:48 -0000
From: "StaffLeavers at arm dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/54742] Switch elimination in FSM loop
Date: Wed, 20 Nov 2013 07:23:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords: missed-optimization
X-Bugzilla-Severity: normal
X-Bugzilla-Who: StaffLeavers at arm dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-54742-4-UAusj2qMM6@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-54742-4@http.gcc.gnu.org/bugzilla/>
References: <bug-54742-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-11/txt/msg01949.txt.bz2
Content-length: 311

http://gcc.gnu.org/bugzilla/show_bug.cgi?idT742

--- Comment #12 from StaffLeavers at arm dot com ---
greta.yorsh no longer works for ARM.

Your email will be forwarded to their line manager.


Please do not reply to this email.
If you need more information, please email real-postmaster@arm.com

Thank you.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (23 preceding siblings ...)
  2013-11-20  7:15 ` manu at gcc dot gnu.org
@ 2013-11-20  7:42 ` manu at gcc dot gnu.org
  2013-11-22 13:10 ` jjcogliati-r1 at yahoo dot com
  25 siblings, 0 replies; 27+ messages in thread
From: manu at gcc dot gnu.org @ 2013-11-20  7:42 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #29 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
I guess this is fixed for GCC 4.9.
>From gcc-bugs-return-435187-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Nov 20 08:36:46 2013
Return-Path: <gcc-bugs-return-435187-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 3650 invoked by alias); 20 Nov 2013 08:36:46 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 3607 invoked by uid 48); 20 Nov 2013 08:36:41 -0000
From: "dcb314 at hotmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/59203] New: config/cris/cris.c:2491: possible typo ?
Date: Wed, 20 Nov 2013 08:36:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: dcb314 at hotmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter
Message-ID: <bug-59203-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-11/txt/msg01964.txt.bz2
Content-length: 1014

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY203

            Bug ID: 59203
           Summary: config/cris/cris.c:2491: possible typo ?
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com

I just ran cppcheck over the trunk source code.

It said

[trunk/gcc/config/cris/cris.c:2491] -> [trunk/gcc/config/cris/cris.c:2491]:
(style) Same expression on both sides of '||'.

Source code is

    enum cris_pic_symbol_type t1 = cris_pic_symbol_type_of (XEXP (x, 0));
    enum cris_pic_symbol_type t2 = cris_pic_symbol_type_of (XEXP (x, 1));

    gcc_assert (t1 == cris_no_symbol || t2 == cris_no_symbol);

    if (t1 == cris_got_symbol || t1 == cris_got_symbol)
      return cris_got_symbol_needing_fixup;

Suggest code rework. It might be as simple as changing t1 to t2 after
the ||, but given the assert, I doubt it.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Bug c/53001] -Wfloat-conversion should be available to warn about floating point errors
  2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
                   ` (24 preceding siblings ...)
  2013-11-20  7:42 ` manu at gcc dot gnu.org
@ 2013-11-22 13:10 ` jjcogliati-r1 at yahoo dot com
  25 siblings, 0 replies; 27+ messages in thread
From: jjcogliati-r1 at yahoo dot com @ 2013-11-22 13:10 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53001

--- Comment #30 from Joshua Cogliati <jjcogliati-r1 at yahoo dot com> ---
Yes, it is fixed so far as I am concerned.  I checked out gcc trunk 205109, and
bootstraped it and tried it out on:

int main(int argc, char ** argv) {
  int i = 3.14;
  return i;
}

int foo(double x)
{
  return x;
}

float foo2(double x) {
  return x;
}

and without the flag it didn't warn, but with the flag it did:
gcc -Wall -Wfloat-conversion -o float_test float_test.c
float_test.c: In function ‘main’:
float_test.c:2:3: warning: conversion to ‘int’ alters ‘double’ constant value
[-Wfloat-conversion]
   int i = 3.14;
   ^
float_test.c: In function ‘foo’:
float_test.c:8:3: warning: conversion to ‘int’ from ‘double’ may alter its
value [-Wfloat-conversion]
   return x;
   ^
float_test.c: In function ‘foo2’:
float_test.c:12:3: warning: conversion to ‘float’ from ‘double’ may alter its
value [-Wfloat-conversion]
   return x;
   ^

I think there are two things remaining to be done.  

1. http://gcc.gnu.org/gcc-4.9/changes.html does not yet list it as a change, 

2. for gcc 4.10 (or what ever the next gcc version is) I think it might be
worth considering as a -Wextra or -Wall.  That however would be a separate bug
number and would require something like the  Patch to fixup gcc float
conversions in GCC and another patch to turn it on with the flag.
>From gcc-bugs-return-435531-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Nov 22 13:11:29 2013
Return-Path: <gcc-bugs-return-435531-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 18187 invoked by alias); 22 Nov 2013 13:11:28 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 18133 invoked by uid 48); 22 Nov 2013 13:11:25 -0000
From: "olegendo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/59243] [SH] Build fails during compiling libjava/interpret.cc with segfault
Date: Fri, 22 Nov 2013 13:11:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords: build
X-Bugzilla-Severity: normal
X-Bugzilla-Who: olegendo at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-59243-4-5fhsPMVh1d@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59243-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59243-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-11/txt/msg02308.txt.bz2
Content-length: 284

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY243

--- Comment #1 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Kazumoto Kojima from comment #0)
> Created attachment 31270 [details]
> A reduced test case

Thanks.  This is a very good test case.  I'm looking into it.


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2013-11-22 13:10 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-16  3:16 [Bug c/53001] New: -Wfloat-conversion should be available to warn about floating point errors jjcogliati-r1 at yahoo dot com
2012-04-16 11:41 ` [Bug c/53001] " manu at gcc dot gnu.org
2012-04-16 12:17 ` jjcogliati-r1 at yahoo dot com
2012-04-16 12:37 ` manu at gcc dot gnu.org
2012-06-07 14:04 ` manu at gcc dot gnu.org
2012-06-22 12:29 ` jjcogliati-r1 at yahoo dot com
2012-06-22 12:41 ` manu at gcc dot gnu.org
2013-09-02 19:50 ` jjcogliati-r1 at yahoo dot com
2013-09-20 16:27 ` jjcogliati-r1 at yahoo dot com
2013-09-20 16:30 ` jjcogliati-r1 at yahoo dot com
2013-09-20 16:39 ` gcc at richardneill dot org
2013-09-20 17:27 ` jjcogliati-r1 at yahoo dot com
2013-09-20 20:27 ` manu at gcc dot gnu.org
2013-09-21  0:25 ` jjcogliati-r1 at yahoo dot com
2013-09-22 23:02 ` jjcogliati-r1 at yahoo dot com
2013-09-26  3:32 ` jjcogliati-r1 at yahoo dot com
2013-09-26 11:50 ` manu at gcc dot gnu.org
2013-09-27 12:06 ` jjcogliati-r1 at yahoo dot com
2013-09-30 12:13 ` jjcogliati-r1 at yahoo dot com
2013-10-11  2:23 ` jjcogliati-r1 at yahoo dot com
2013-10-11  2:31 ` jjcogliati-r1 at yahoo dot com
2013-10-13 13:48 ` jjcogliati-r1 at yahoo dot com
2013-10-16  2:48 ` jjcogliati-r1 at yahoo dot com
2013-10-22  1:37 ` jjcogliati-r1 at yahoo dot com
2013-11-20  7:15 ` manu at gcc dot gnu.org
2013-11-20  7:42 ` manu at gcc dot gnu.org
2013-11-22 13:10 ` jjcogliati-r1 at yahoo dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).