[Bug sanitizer/115791] division by zero check missing at optimization levels -O2 and -O3

2024-07-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115791 --- Comment #3 from Andrew Pinski --- So fixed for GCC 11. Note GCC 10.5.0 was the last release of GCC 10.x series and there will be no other new 10.x.

[Bug sanitizer/115791] division by zero check missing at optimization levels -O2 and -O3

2024-07-04 Thread xry111 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115791 Xi Ruoyao changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill

[Bug sanitizer/115791] division by zero check missing at optimization levels -O2 and -O3

2024-07-04 Thread xry111 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115791 Xi Ruoyao changed: What|Removed |Added CC||xry111 at gcc dot gnu.org --- Comment #1

[Bug sanitizer/115791] New: division by zero check missing at optimization levels -O2 and -O3

2024-07-04 Thread bic60176 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115791 Bug ID: 115791 Summary: division by zero check missing at optimization levels -O2 and -O3 Product: gcc Version: 10.5.0 Status: UNCONFIRMED Severity: normal

[Bug middle-end/112771] during GIMPLE pass: bitintlower0 ICE: in build_bitint_type, at tree.cc:7178 with _BitInt(65535) and division by zero

2023-12-01 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112771 Jakub Jelinek changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED

[Bug middle-end/112771] during GIMPLE pass: bitintlower0 ICE: in build_bitint_type, at tree.cc:7178 with _BitInt(65535) and division by zero

2023-12-01 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112771 --- Comment #2 from GCC Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:9bfebcb1b7ae4e7160644f2104424d6bab4a23f7 commit r14-6050-g9bfebcb1b7ae4e7160644f2104424d6bab4a23f7 Author: Jakub Jelinek Date:

[Bug middle-end/112771] during GIMPLE pass: bitintlower0 ICE: in build_bitint_type, at tree.cc:7178 with _BitInt(65535) and division by zero

2023-11-30 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112771 Jakub Jelinek changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Ever confirmed|0

[Bug middle-end/112771] New: during GIMPLE pass: bitintlower0 ICE: in build_bitint_type, at tree.cc:7178 with _BitInt(65535) and division by zero

2023-11-29 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112771 Bug ID: 112771 Summary: during GIMPLE pass: bitintlower0 ICE: in build_bitint_type, at tree.cc:7178 with _BitInt(65535) and division by zero Product: gcc

[Bug middle-end/111711] [14 Regression] ICE: in maybe_legitimize_operand, at optabs.cc:8046 at -O1 with division by zero

2023-10-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111711 Andrew Pinski changed: What|Removed |Added Resolution|--- |DUPLICATE Status|NEW

[Bug middle-end/111711] [14 Regression] ICE: in maybe_legitimize_operand, at optabs.cc:8046 at -O1 with division by zero

2023-10-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111711 --- Comment #2 from Andrew Pinski --- (In reply to Andrew Pinski from comment #1) > It was introduced by r14-2667-gceae1400cf24f329393e96dd9720 . > > We have: > long int x; > int _3; > _Bool _5; > _3 = 0 / 0; > _5 = _3 == 822920; >

[Bug middle-end/111711] [14 Regression] ICE: in maybe_legitimize_operand, at optabs.cc:8046 at -O1 with division by zero

2023-10-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111711 Andrew Pinski changed: What|Removed |Added Ever confirmed|0 |1 Keywords|needs-bisection

[Bug rtl-optimization/111711] [14 Regression] ICE: in maybe_legitimize_operand, at optabs.cc:8046 at -O1 with division by zero

2023-10-06 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111711 Richard Biener changed: What|Removed |Added Target Milestone|--- |14.0 Keywords|

[Bug rtl-optimization/111711] New: [14 Regression] ICE: in maybe_legitimize_operand, at optabs.cc:8046 at -O1 with division by zero

2023-10-05 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111711 Bug ID: 111711 Summary: [14 Regression] ICE: in maybe_legitimize_operand, at optabs.cc:8046 at -O1 with division by zero Product: gcc Version: 14.0 Status: UNCONFIRMED

Avoid division by zero in fold_loop_internal_call

2023-08-14 Thread Jan Hubicka via Gcc-patches
Hi, My patch to fix profile after folding internal call is missing check for the case profile was already zero before if-conversion. Bootstrapped/regtested x86_64-linux, comitted. gcc/ChangeLog: PR gcov-profile/110988 * tree-cfg.cc (fold_loop_internal_call): Avoid division

Fix division by zero in tree-ssa-loop-split

2023-08-10 Thread Jan Hubicka via Gcc-patches
for division by zero. gcc/testsuite/ChangeLog: PR middle-end/110923 * gcc.dg/tree-ssa/pr110923.c: New test. diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr110923.c b/gcc/testsuite/gcc.dg/tree-ssa/pr110923.c new file mode 100644 index 000..8f5720a5e9e --- /dev/null +++ b/gcc

[Bug middle-end/109578] fail to remove dead code due to division by zero

2023-04-20 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109578 --- Comment #5 from Andrew Pinski --- (In reply to Andrew Pinski from comment #3) > Anyways maybe the issue with PR 29968 was a scheduling issue which was fixed > later on that GCC didn't realize divide could trap. I was right on that, it was

[Bug middle-end/109578] fail to remove dead code due to division by zero

2023-04-20 Thread vincent-gcc at vinc17 dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109578 --- Comment #4 from Vincent Lefèvre --- (In reply to Andrew Pinski from comment #3) > Anyways maybe the issue with PR 29968 was a scheduling issue which was fixed > later on that GCC didn't realize divide could trap. OK, thanks, I can see your

[Bug rtl-optimization/41239] Scheduler reorders division by zero before a call that might not return

2023-04-20 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41239 Andrew Pinski changed: What|Removed |Added CC||tiamat at komi dot mts.ru --- Comment

[Bug c/29968] integer division by zero with optimization

2023-04-20 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=29968 Andrew Pinski changed: What|Removed |Added Resolution|INVALID |DUPLICATE --- Comment #6 from Andrew

[Bug c/29968] integer division by zero with optimization

2023-04-20 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=29968 --- Comment #5 from Andrew Pinski --- (In reply to Vincent Lefèvre from comment #4) > (In reply to Andreas Schwab from comment #2) > > Your program is invoking undefined behaviour. You should not perform the > > division if the divisor is zero.

[Bug middle-end/109578] fail to remove dead code due to division by zero

2023-04-20 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109578 --- Comment #3 from Andrew Pinski --- (In reply to Vincent Lefèvre from comment #2) > (In reply to Andrew Pinski from comment #1) > > We don't removing code before undefined behavior ... > > That is GCC does not know that printf does not have

[Bug c/29968] integer division by zero with optimization

2023-04-20 Thread vincent-gcc at vinc17 dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=29968 Vincent Lefèvre changed: What|Removed |Added CC||vincent-gcc at vinc17 dot net ---

[Bug middle-end/109578] fail to remove dead code due to division by zero

2023-04-20 Thread vincent-gcc at vinc17 dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109578 --- Comment #2 from Vincent Lefèvre --- (In reply to Andrew Pinski from comment #1) > We don't removing code before undefined behavior ... > That is GCC does not know that printf does not have side effects. Then GCC is incorrect in bug 29968,

[Bug middle-end/109578] fail to remove dead code due to division by zero

2023-04-20 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109578 Andrew Pinski changed: What|Removed |Added Resolution|--- |WONTFIX Status|UNCONFIRMED

[Bug middle-end/109578] New: fail to remove dead code due to division by zero

2023-04-20 Thread vincent-gcc at vinc17 dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109578 Bug ID: 109578 Summary: fail to remove dead code due to division by zero Product: gcc Version: 12.2.1 Status: UNCONFIRMED Severity: normal Priority: P3

[Bug analyzer/99669] RFE: detect division by zero in analyzer

2023-03-20 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99669 David Malcolm changed: What|Removed |Added CC||geoffreydgr at icloud dot com ---

Re: Division by zero on A53 which does not raise an exception

2022-11-29 Thread Szabolcs Nagy via Gcc
The 11/28/2022 21:37, Stephen Smith via Binutils wrote: > I am working on a project which is using an A53 core. The core does not > raise an exception if there is a division by zero (for either integer or > floating point division). floating-point division by zero signals the FE_

Re: Division by zero on A53 which does not raise an exception

2022-11-29 Thread Richard Biener via Gcc
On Tue, Nov 29, 2022 at 5:39 AM Stephen Smith via Gcc wrote: > > I am working on a project which is using an A53 core. The core does not > raise an exception if there is a division by zero (for either integer or > floating point division). > > The designers chose

Division by zero on A53 which does not raise an exception

2022-11-28 Thread Stephen Smith via Gcc
I am working on a project which is using an A53 core. The core does not raise an exception if there is a division by zero (for either integer or floating point division). The designers chose to set status bits for the floating point case but not raise an exception.With the integer

[PATCH] tree-optimization/106189 - avoid division by zero exception

2022-07-26 Thread Richard Biener via Gcc-patches
The diagnostic code can end up with zero sized array elements with T[][0] and the wide-int code nicely avoids exceptions when dividing by zero in one codepath but not in another. The following fixes the exception by using wide-int in both paths. Bootstrapped and tested on

[Bug analyzer/99669] RFE: detect division by zero in analyzer

2022-06-08 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99669 David Malcolm changed: What|Removed |Added Blocks||105887 --- Comment #2 from David

[Ada] Move messages on division by zero to the right operand

2022-01-06 Thread Pierre-Marie de Rodat via Gcc-patches
All compile-time messages about division by zero are now located at the right operand. Previously some of them were located at the division operator, which was inconsistent. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_eval.adb (Eval_Arithmetic_Op): Add Loc parameter

[Bug analyzer/99669] RFE: detect division by zero in analyzer

2021-11-16 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99669 --- Comment #1 from David Malcolm --- I implemented a version of this (-Wanalyzer-tainted-divisor) for GCC 12 in: https://gcc.gnu.org/pipermail/gcc-patches/2021-November/584356.html

[Bug c/21438] Warning about division by zero depends on lexical form

2021-09-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=21438 Andrew Pinski changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned

[Bug tree-optimization/46352] ICE: division by zero with -fdump-tree-tracer

2021-08-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46352 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Known to work|

[Bug analyzer/99669] New: RFE: detect division by zero in analyzer

2021-03-19 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99669 Bug ID: 99669 Summary: RFE: detect division by zero in analyzer Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: analyzer

Re: [PATCH] libstdc++: Fix division by zero in std::sample

2020-10-20 Thread Patrick Palka via Gcc-patches
On Tue, 20 Oct 2020, Jonathan Wakely wrote: > On 21/09/20 16:01 +0100, Jonathan Wakely wrote: > > On 18/09/20 21:08 -0400, Patrick Palka via Libstdc++ wrote: > > > This fixes a division by zero in the selection-sampling std::__search > > > overload when the inpu

Re: [PATCH] libstdc++: Fix division by zero in std::sample

2020-10-20 Thread Jonathan Wakely via Gcc-patches
On 21/09/20 16:01 +0100, Jonathan Wakely wrote: On 18/09/20 21:08 -0400, Patrick Palka via Libstdc++ wrote: This fixes a division by zero in the selection-sampling std::__search overload when the input range is empty (and hence __unsampled_sz is 0). Tested on x86_64-pc-linux-gnu. libstdc++-v3

Re: [PATCH] libstdc++: Fix division by zero in std::sample

2020-09-21 Thread Jonathan Wakely via Gcc-patches
On 18/09/20 21:08 -0400, Patrick Palka via Libstdc++ wrote: This fixes a division by zero in the selection-sampling std::__search overload when the input range is empty (and hence __unsampled_sz is 0). Tested on x86_64-pc-linux-gnu. libstdc++-v3/ChangeLog: * include/bits/stl_algo.h

Re: [PATCH] libstdc++: Fix division by zero in std::sample

2020-09-21 Thread Patrick Palka via Gcc-patches
On Fri, 18 Sep 2020, Patrick Palka wrote: > This fixes a division by zero in the selection-sampling std::__search Whoops, this line say std::__sample, not std::__search. > overload when the input range is empty (and hence __unsampled_sz is 0). > > Tested on x86_64-pc-linux-gnu.

[PATCH] libstdc++: Fix division by zero in std::sample

2020-09-18 Thread Patrick Palka via Gcc-patches
This fixes a division by zero in the selection-sampling std::__search overload when the input range is empty (and hence __unsampled_sz is 0). Tested on x86_64-pc-linux-gnu. libstdc++-v3/ChangeLog: * include/bits/stl_algo.h (__sample): Exit early when the input range is empty

[Bug tree-optimization/96807] Division by zero produces zero with gcc -O2

2020-08-30 Thread pinskia at gcc dot gnu.org
|--- |INVALID --- Comment #2 from Andrew Pinski --- >Instead of giving division by zero or infinity, it gives zero. Is that even defined in Fortran, I think the answer is NO. so closing as invalid.

[Bug tree-optimization/96807] Division by zero produces zero with gcc -O2

2020-08-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96807 --- Comment #1 from Richard Biener --- Division by zero is undefined behavior so we simplify 1/x to 0 if x is known to be not one [unless there's literal 1/0 which is sometimes used to generate traps].

[Bug tree-optimization/96807] New: Division by zero produces zero with gcc -O2

2020-08-26 Thread fazedo at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96807 Bug ID: 96807 Summary: Division by zero produces zero with gcc -O2 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component

Re: [PATCH] Fortran : ICE for division by zero in declaration PR95882

2020-08-26 Thread Thomas Koenig via Gcc-patches
Hi Mark, OK to commit and backport? OK. Thanks for the patch! Best regards Thomas

[PATCH] Fortran : ICE for division by zero in declaration PR95882

2020-08-25 Thread Mark Eggleston
Second attempt, this time with the correct attachment. OK to commit and backport? [PATCH] Fortran  : ICE for division by zero in declaration PR95882 A length expression containing a divide by zero in a character declaration will result in an ICE if the constant is anymore complicated

Re: [PATCH] Fortran : ICE for division by zero in declaration PR95882

2020-08-25 Thread Mark Eggleston
On 25/08/2020 07:13, Mark Eggleston wrote: On 24/08/2020 17:42, Thomas Koenig wrote: Hi Mark, OK to commit and backport? The test cases mentioned in the ChangeLog are not in the patch, instead there is the test case for PR 96624. Could you correct that? Whoops, yes I'll fix that. It

Re: [PATCH] Fortran : ICE for division by zero in declaration PR95882

2020-08-25 Thread Mark Eggleston
On 24/08/2020 17:42, Thomas Koenig wrote: Hi Mark, OK to commit and backport? The test cases mentioned in the ChangeLog are not in the patch, instead there is the test case for PR 96624. Could you correct that? Whoops, yes I'll fix that. Best regards Thomas --

Re: [PATCH] Fortran : ICE for division by zero in declaration PR95882

2020-08-24 Thread Thomas Koenig via Gcc-patches
Hi Mark, OK to commit and backport? The test cases mentioned in the ChangeLog are not in the patch, instead there is the test case for PR 96624. Could you correct that? Best regards Thomas

[PATCH] Fortran : ICE for division by zero in declaration PR95882

2020-08-24 Thread Mark Eggleston
Please find attached a fix for PR95882. Tested on x86_64 with bootstrap. OK to commit and backport? Fortran  : ICE for division by zero in declaration PR95882 A length expression containing a divide by zero in a character declaration will result in an ICE if the constant is anymore

Re: [PATCH] RISC-V: align RISC-V software division with hardware specification in case of division by zero

2020-06-02 Thread Jim Wilson
On Fri, May 29, 2020 at 1:53 AM MOSER Virginie via Gcc-patches wrote: > The assembly code in libgcc/config/riscv/div.S does not handle the division > by zero as specified in the riscv-spec v2.2 chapter 6.2 in case of signed > division: This looks OK. There are some administrative

[PATCH] RISC-V: align RISC-V software division with hardware specification in case of division by zero

2020-05-29 Thread MOSER Virginie via Gcc-patches
The assembly code in libgcc/config/riscv/div.S does not handle the division by zero as specified in the riscv-spec v2.2 chapter 6.2 in case of signed division: "The quotient of division by zero has all bits set, i.e. 2XLEN−1 for unsigned division or−1 for signed division." When

Re: PR fortran/95053 - division by zero constants

2020-05-17 Thread Thomas Koenig via Gcc-patches
Am 15.05.20 um 22:33 schrieb Harald Anlauf: Here's a new attempt to finally fix this PR and any known fallout. In order to handle division by zero in declarations, but still accept the code snippet adapted from 521.wrf_r (from spec2017), I removed the hunk that was added to fix PR94399

PR fortran/95053 - division by zero constants

2020-05-15 Thread Harald Anlauf
Here's a new attempt to finally fix this PR and any known fallout. In order to handle division by zero in declarations, but still accept the code snippet adapted from 521.wrf_r (from spec2017), I removed the hunk that was added to fix PR94399, and deferred the handling to a later stage. One case

Re: [Patch] PR fortran/93499 - ICE on division by zero in declaration statements

2020-05-10 Thread Thomas Koenig via Gcc-patches
Hi Harald, the attached should be mostly self-explaining. Division by zero handling appeared to be incomplete. It was not dealt with properly when occurring in declaration statements. We now try to handle this. OK for mainline? OK. Thanks for the patch! Regards Thomas

[Patch] PR fortran/93499 - ICE on division by zero in declaration statements

2020-05-09 Thread Harald Anlauf
Hi, the attached should be mostly self-explaining. Division by zero handling appeared to be incomplete. It was not dealt with properly when occurring in declaration statements. We now try to handle this. OK for mainline? Thanks, Harald PR fortran/93499 - ICE on division by zero

Fix ICE with cast of division by zero (PR c/93348)

2020-01-21 Thread Joseph Myers
Bug 93348 reports an ICE on certain cases of casts of expressions that may appear only in unevaluated parts of integer constant expressions, arising from the generation of nested C_MAYBE_CONST_EXPRs. This patch fixes it by adding a call to remove_c_maybe_const_expr in the integer-operands case,

Re: [patch, fortran] Updated fix PR 92961, ICE on division by zero error in array bounds

2019-12-29 Thread Jerry
bugs vs. 461 closed, which is not bad). Regards Thomas 2019-12-22  Thomas Koenig  PR fortran/92961 * gfortran.h (gfc_seen_div0): Add declaration. * arith.h (gfc_seen_div0): Add definition. (eval_intrinsic): For integer division by zero, set gfc_seen_div0. * decl.c

*ping* [patch, fortran] Updated fix PR 92961, ICE on division by zero error in array bounds

2019-12-29 Thread Thomas Koenig
Am 22.12.19 um 16:28 schrieb Thomas Koenig: here is an update for the fix for PR 92961, which also takes care of the second test case in the PR (included in the first one). The patch itself should be clear enough - make sure that there is a MATCH_ERROR on matching an array spec which contains

[patch, fortran] Updated fix PR 92961, ICE on division by zero error in array bounds

2019-12-22 Thread Thomas Koenig
Koenig PR fortran/92961 * gfortran.h (gfc_seen_div0): Add declaration. * arith.h (gfc_seen_div0): Add definition. (eval_intrinsic): For integer division by zero, set gfc_seen_div0. * decl.c (variable_decl): If resolution resp. simplification fails

Re: [pach, fortran] Fix PR 92961, ICE on division by zero error in array bounds

2019-12-20 Thread Thomas Koenig
the attached patch fixes an ICE in an array declaration where the specified size came from 0/0. This is an 8/9/10 regression. Actually, it does not fix all testcases in the PR, so some more tweaking is still needed. Regards Thomas

[pach, fortran] Fix PR 92961, ICE on division by zero error in array bounds

2019-12-20 Thread Thomas Koenig
. * arith.h (gfc_seen_div0): Add definition. (eval_intrinsic): For integer division by zero, issue gfc_error_now and set gfc_seen_div0. * decl.c (variable_decl): If a division by zero error has been seen previously, do not issue an addtional error

[Bug other/88499] Check for less than zero removed before floating point division causes division by zero (fast-math mode)

2018-12-14 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88499 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug other/88499] Check for less than zero removed before floating point division causes division by zero (fast-math mode)

2018-12-14 Thread fuscated at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88499 --- Comment #3 from Teodor Petrov --- @Marc Glisse: Would it be possible to give an explanation why this is not a good idea? Link to some kind of a documentation which explains that this behaviour is expected?

[Bug other/88499] Check for less than zero removed before floating point division causes division by zero (fast-math mode)

2018-12-14 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88499 --- Comment #2 from Marc Glisse --- I don't think using fenv.h with -ffast-math makes much sense.

[Bug other/88499] Check for less than zero removed before floating point division causes division by zero (fast-math mode)

2018-12-14 Thread fuscated at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88499 --- Comment #1 from Teodor Petrov --- Here are the commands used to reproduce the bug: $ g++ -g -fPIC -Ofast -msse4.2 -std=c++11 -ffunction-sections -fdata-sections -ffast-math -fvisibility=hidden -fexceptions -Wno-c++11-extensions

[Bug other/88499] New: Check for less than zero removed before floating point division causes division by zero (fast-math mode)

2018-12-14 Thread fuscated at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88499 Bug ID: 88499 Summary: Check for less than zero removed before floating point division causes division by zero (fast-math mode) Product: gcc Version: 8.2.0 Status

[Bug c++/80744] Detect Possible Division By Zero and give a warning in C/C++ [-Wmaybe-div-by-zero]

2018-11-01 Thread egallager at gcc dot gnu.org
ree that diagnosing (A) or (C) under -Wdiv-by-zero would not be > appropriate because the option controls compile-time division by zero and > there is none here. > > Extending -Wdiv-by-zero to diagnose possible division by zero would > undoubtedly make the option exceedingly noisy. Introd

[Bug libstdc++/67011] division by zero in std::exponential_distribution

2018-05-14 Thread redi at gcc dot gnu.org
iderable larger than for log(rng). Hmm, let's confirm the bug for that, instead of the division-by-zero that should be fixed.

[Bug c/82349] float INFINITY issue with division by zero in regression with compiler option '-ffast-math'

2017-09-28 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82349 --- Comment #5 from Andreas Schwab --- Undefined means anything can happen, not even consistently.

[Bug c/82349] float INFINITY issue with division by zero in regression with compiler option '-ffast-math'

2017-09-28 Thread marc.pres at gmx dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82349 --- Comment #4 from Marcello Presulli --- Thats clear, but why are the 2 terms different each. If so, they should output the same, because what would be the difference between 1.0/denom and 1.0/0 in case of fast-math ?

[Bug c/82351] float INFINITY issue with division by zero in regression with compiler option '-ffast-math'

2017-09-28 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82351 Andreas Schwab changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED

[Bug c/82349] float INFINITY issue with division by zero in regression with compiler option '-ffast-math'

2017-09-28 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82349 --- Comment #3 from Andreas Schwab --- *** Bug 82351 has been marked as a duplicate of this bug. ***

[Bug c/82350] float INFINITY issue with division by zero in regression with compiler option '-ffast-math'

2017-09-28 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82350 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/82349] float INFINITY issue with division by zero in regression with compiler option '-ffast-math'

2017-09-28 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82349 --- Comment #2 from Andrew Pinski --- *** Bug 82350 has been marked as a duplicate of this bug. ***

[Bug c/82349] float INFINITY issue with division by zero in regression with compiler option '-ffast-math'

2017-09-28 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82349 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/82351] New: float INFINITY issue with division by zero in regression with compiler option '-ffast-math'

2017-09-28 Thread marc.pres at gmx dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82351 Bug ID: 82351 Summary: float INFINITY issue with division by zero in regression with compiler option '-ffast-math' Product: gcc Version: unknown Status: UNCONFIRMED

[Bug c/82350] New: float INFINITY issue with division by zero in regression with compiler option '-ffast-math'

2017-09-28 Thread marc.pres at gmx dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82350 Bug ID: 82350 Summary: float INFINITY issue with division by zero in regression with compiler option '-ffast-math' Product: gcc Version: unknown Status: UNCONFIRMED

[Bug c/82349] New: float INFINITY issue with division by zero in regression with compiler option '-ffast-math'

2017-09-28 Thread marc.pres at gmx dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82349 Bug ID: 82349 Summary: float INFINITY issue with division by zero in regression with compiler option '-ffast-math' Product: gcc Version: unknown Status: UNCONFIRMED

[Ada] Issue check instead of error in static division by zero

2016-04-18 Thread Arnaud Charlet
com> * sem_eval.adb (Eval_Arithmetic_Op): Do not issue error on static division by zero, instead possibly issue a warning. * sem_res.adb (Resolve_Arithmetic_Op): Do not issue error on static division by zero, instead add check flag on original expr

[PATCH 2/2] [graphite] check for ISL generated code that leads to division by zero

2015-11-30 Thread Sebastian Pop
we used to generate modulo and division by zero because ISL uses big numbers which translate to zero in modulo arithmetic. The patch also improves error handling and bails out early in case of wrong code gen. --- gcc/graphite-isl-ast-to-gimple.c | 85 +++- 1

[Bug libstdc++/67011] division by zero in std::exponential_distribution

2015-07-27 Thread kretz at kde dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67011 Matthias Kretz kretz at kde dot org changed: What|Removed |Added CC||kretz at kde dot

[Bug libstdc++/67011] division by zero in std::exponential_distribution

2015-07-26 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67011 --- Comment #1 from Jonathan Wakely redi at gcc dot gnu.org --- One is for std::exponential_distribution and one is for std::tr1:exponential_distribution. The former is already fixed and the latter is moribund and we don't really care about it

[Bug libstdc++/67011] division by zero in std::exponential_distribution

2015-07-26 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67011 --- Comment #2 from Jonathan Wakely redi at gcc dot gnu.org --- Although if you're still seeing a problem with std::exponential_distribution then I guess it's not the same bug. (Please ignore tr1/random.h unless you're actually using

[Bug libstdc++/67011] New: division by zero in std::exponential_distribution

2015-07-25 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67011 Bug ID: 67011 Summary: division by zero in std::exponential_distribution Product: gcc Version: 4.8.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component

Re: [PATCH] Don't fold away division by zero (PR middle-end/66127)

2015-05-14 Thread Steve Ellcey
On Thu, 2015-05-14 at 09:42 -0700, Steve Ellcey wrote: Marek, This may be unrelated to your patches for PR 66127 and 66066 but I am having a new failure when building the latest glibc with the latest GCC. I haven't yet tracked down exactly which patch caused the problem. Included is a

Re: [PATCH] Don't fold away division by zero (PR middle-end/66127)

2015-05-14 Thread Marek Polacek
On Thu, May 14, 2015 at 10:07:56AM -0700, Steve Ellcey wrote: Sorry for the noise, it looks like this failure is not related to any recent changes in GCC. I still get the error in older GCC's so I think something must have changed in glibc. I will start digging there. Yeah -- strict aliasing

Re: [PATCH] Don't fold away division by zero (PR middle-end/66127)

2015-05-14 Thread Steve Ellcey
Marek, This may be unrelated to your patches for PR 66127 and 66066 but I am having a new failure when building the latest glibc with the latest GCC. I haven't yet tracked down exactly which patch caused the problem. Included is a cutdown test case from libio/memstream.c in glibc that results

Re: [PATCH] Don't fold away division by zero (PR middle-end/66127)

2015-05-14 Thread Steve Ellcey
On Thu, 2015-05-14 at 19:22 +0200, Marek Polacek wrote: On Thu, May 14, 2015 at 10:07:56AM -0700, Steve Ellcey wrote: Sorry for the noise, it looks like this failure is not related to any recent changes in GCC. I still get the error in older GCC's so I think something must have changed in

[Bug c/66127] Division by zero gets folded away

2015-05-14 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66127 --- Comment #10 from Marek Polacek mpolacek at gcc dot gnu.org --- Author: mpolacek Date: Thu May 14 11:42:53 2015 New Revision: 223193 URL: https://gcc.gnu.org/viewcvs?rev=223193root=gccview=rev Log: PR c/66066 PR c/66127

[Bug c/66127] Division by zero gets folded away

2015-05-14 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66127 Marek Polacek mpolacek at gcc dot gnu.org changed: What|Removed |Added Status|ASSIGNED|RESOLVED

Re: [PATCH] Don't fold away division by zero (PR middle-end/66127)

2015-05-14 Thread Richard Biener
On May 14, 2015 12:46:06 AM GMT+02:00, Joseph Myers jos...@codesourcery.com wrote: On Wed, 13 May 2015, Marek Polacek wrote: Rather, how about having an extra argument to c_fully_fold_internal (e.g. for_int_const) indicating that the folding is of an expression with integer constant

Re: [PATCH] Don't fold away division by zero (PR middle-end/66127)

2015-05-14 Thread Marek Polacek
On Thu, May 14, 2015 at 09:59:49AM +0200, Richard Biener wrote: Do the patches allow us to remove the restrictions from the folding patterns? With the c_fully_fold_internal patches there's no need to tweak any match.pd patterns. So PR66127 + PR66066 are to be solved solely in the C FE. Is that

[Bug c/66127] Division by zero gets folded away

2015-05-14 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66127 Marek Polacek mpolacek at gcc dot gnu.org changed: What|Removed |Added Component|middle-end |c ---

Re: [PATCH] Don't fold away division by zero (PR middle-end/66127)

2015-05-14 Thread Marek Polacek
On Wed, May 13, 2015 at 10:46:06PM +, Joseph Myers wrote: Yes. The two patches are OK together, though I think it would be better Thanks. to add for_int_const checks also in the cases of unary operations, , || and ?: (the last three being cases where it's only the evaluated operands

Re: [PATCH] Don't fold away division by zero (PR middle-end/66127)

2015-05-14 Thread Jakub Jelinek
On Thu, May 14, 2015 at 11:48:55AM +0200, Richard Biener wrote: On May 14, 2015 10:10:35 AM GMT+02:00, Marek Polacek pola...@redhat.com wrote: On Thu, May 14, 2015 at 09:59:49AM +0200, Richard Biener wrote: Do the patches allow us to remove the restrictions from the folding patterns?

Re: [PATCH] Don't fold away division by zero (PR middle-end/66127)

2015-05-14 Thread Marek Polacek
On Thu, May 14, 2015 at 11:48:55AM +0200, Richard Biener wrote: On May 14, 2015 10:10:35 AM GMT+02:00, Marek Polacek pola...@redhat.com wrote: On Thu, May 14, 2015 at 09:59:49AM +0200, Richard Biener wrote: Do the patches allow us to remove the restrictions from the folding patterns?

Re: [PATCH] Don't fold away division by zero (PR middle-end/66127)

2015-05-14 Thread Richard Biener
On May 14, 2015 10:10:35 AM GMT+02:00, Marek Polacek pola...@redhat.com wrote: On Thu, May 14, 2015 at 09:59:49AM +0200, Richard Biener wrote: Do the patches allow us to remove the restrictions from the folding patterns? With the c_fully_fold_internal patches there's no need to tweak any

[Bug middle-end/66127] Division by zero gets folded away

2015-05-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66127 --- Comment #4 from Richard Biener rguenth at gcc dot gnu.org --- Note that the inconsistent handling of */% 0 has been 1:1 translated from fold-const.c (also the comments).

[Bug middle-end/66127] Division by zero gets folded away

2015-05-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66127 Marek Polacek mpolacek at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED

  1   2   3   4   >