[Bug tree-optimization/126641] [17 Regression], ice in frange_nextafter, at range-op-float.cc:315 by r17-2929-g1e5aaad93d8426

"hjl.tools at gmail dot com via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126641

--- Comment #15 from H.J. Lu <hjl.tools at gmail dot com> ---
When real_nextafter is called from

#0  0x00000000022e1f60 in real_nextafter (r=r@entry=0x7fffffff8100, fmt=..., 
    x=0x7fffffff8180, x@entry=0x1, y=0x420fc80 <dconstinf>)
    at /export/gnu/import/git/gitlab/x86-gcc/gcc/real.cc:5395
#1  0x00000000022c9ff8 in frange_nextafter (mode=<optimized out>, 
    mode@entry=E_DFmode, value=..., inf=...)
    at /export/gnu/import/git/gitlab/x86-gcc/gcc/range-op-float.cc:314
#2  0x00000000027a5cde in frange_fusible_p (mode=E_DFmode, a_max=..., 
    b_min=...) at /export/gnu/import/git/gitlab/x86-gcc/gcc/value-range.cc:1041
#3  frange_fusible_p (mode=<optimized out>, a_max=..., b_min=...)
    at /export/gnu/import/git/gitlab/x86-gcc/gcc/value-range.cc:1035

(gdb) f 0
#0  0x00000000022e1f60 in real_nextafter (r=r@entry=0x7fffffff8100, fmt=..., 
    x=0x7fffffff8180, x@entry=0x1, y=0x420fc80 <dconstinf>)
    at /export/gnu/import/git/gitlab/x86-gcc/gcc/real.cc:5395
5395      SET_REAL_EXP (r, REAL_EXP (x));
(gdb) 

overrides the stack:

#define SET_REAL_EXP(REAL, EXP) \
  ((REAL)->uexp = ((unsigned int)(EXP) & (unsigned int)((1 << EXP_BITS) - 1)))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.