[Bug c/87128] New: Wrong Value Generated for m32 without optimization

2018-08-28 Thread neha.gnu.gcc at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87128

Bug ID: 87128
   Summary: Wrong Value Generated for m32 without optimization
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: neha.gnu.gcc at gmail dot com
  Target Milestone: ---

Created attachment 44615
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44615&action=edit
Testcase to generate the issue

When the attached file is compiled for -m32 without any optimization,
it generates wrong result.
$gcc test.c -m32
$ ./a.out
result = -8388608.00-> Wrong result

$gcc test.c -m32 -O1
$ ./a.out
result = 0.00   -> Correct result

Additional Info

Checked with many native GCC from GCC-4.1.0 to current upstream sources.

The result in only wrong when the values of exponents add to zero.
And the value of a is equal or greater than 1.0e23
Example1 a = 1.0e23 b = 1.0e15 c = 1.0e8
Example2 a = 1.0e28 b = 1.0e15 c = 1.0e13

The issue is not observed in the following scenarios
1. Any optimization is enabled.
2. m64 
3. Precision value set to mpc64

Are the values greater than 1.0e23 not handled by 32 properly?
Is anything obvious being missed in the testcase?

[Bug c/87128] Wrong Value Generated for m32 without optimization

2018-08-28 Thread neha.gnu.gcc at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87128

--- Comment #4 from Neha Gowda  ---
Thanks for the explanation.

[Bug c++/52869] [DR 1207] "this" not being allowed in noexcept clauses

2018-09-04 Thread neha.gnu.gcc at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52869

Neha Gowda  changed:

   What|Removed |Added

 CC||neha.gnu.gcc at gmail dot com

--- Comment #7 from Neha Gowda  ---
cat test.cpp

==
#define _NOEXCEPT_OP(x) noexcept(x)

template inline
bool _Swap_adl(_Ty& _Left, _Ty& _Right)
{   
return (true);
}

template
struct pair
{   
typedef pair<_Ty1, _Ty2> _Myt;
typedef _Ty1 first_type;
typedef _Ty2 second_type;

void swap(_Myt& _Right)
_NOEXCEPT_OP(_NOEXCEPT_OP(_Swap_adl(this->first, _Right.first))
&& _NOEXCEPT_OP(_Swap_adl(this->second,
_Right.second)))

{   
if (this != &_Right)
{   // different, worth swapping
_Swap_adl(first, _Right.first);
_Swap_adl(second, _Right.second);
}
}
_Ty1 first; 
_Ty2 second;
};
==
g++ test.cpp -c

test.cpp:18:39: error: invalid use of ‘this’ at top level
test.cpp:19:30: error: invalid use of ‘this’ at top level

Same issue with the current upstream sources as well.
Please let me know if there is any patch or workaround to fix the issue.

Else please let me know how to fix this issue in GCC.

Thanks