Bug 121824 - 0/0 trapping is removed
Summary: 0/0 trapping is removed
Status: RESOLVED DUPLICATE of bug 34678
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 15.2.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-09-06 05:06 UTC by Fred J. Tydeman
Modified: 2025-09-06 09:29 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fred J. Tydeman 2025-09-06 05:06:29 UTC
This fails:

#include <assert.h>
#include <limits.h>
#include <errno.h>
#include <stdio.h>
#include <float.h>
#include <fenv.h>
#include <math.h>	/* glibc 2.41-11 */

#pragma STDC FENV_ACCESS ON
#pragma STDC FP_CONTRACT OFF
#pragma STDC FENV_ROUND FE_TONEAREST
#pragma STDC FENV_DEC_ROUND FE_DEC_TONEAREST
#pragma STDC CX_LIMITED_RANGE OFF

int main(void){
  
  if(1){
    int d7;
    int flags;
    d7 = ( 1, (0./0.), 0 );	/* should raise invalid */
    flags = fetestexcept( FE_ALL_EXCEPT );
    assert( 0 == d7 );
    assert( 0 != flags );	/* fails here */
  }
  return 0;
}
Comment 1 Xi Ruoyao 2025-09-06 09:29:12 UTC
Still because we don't support FENV_ACCESS yet.

*** This bug has been marked as a duplicate of bug 34678 ***