Skip to content

Commit

Permalink
sun/oracle workshop cc: use -O1 (same as -xO1) to around probable bug
Browse files Browse the repository at this point in the history
Fixes #21535
  • Loading branch information
tonycoz committed Nov 6, 2023
1 parent a23e475 commit f4ed4ee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion hints/linux.sh
Expand Up @@ -111,7 +111,9 @@ case "`${cc:-cc} -V 2>&1`" in
# 'Sun' and the 'C': Examples:
# cc: Sun C 5.9 Linux_i386 Patch 124871-01 2007/07/31
# cc: Sun Ceres C 5.10 Linux_i386 2008/07/10
test "$optimize" || optimize='-xO2'
# cc: Studio 12.6 Sun C 5.15 Linux_i386 2017/05/30
# GH #21535 - apparent optimization bug in workshop cc
test "$optimize" || optimize='-O1'
cccdlflags='-KPIC'
lddlflags='-G -Bdynamic'
# Sun C doesn't support gcc attributes, but, in many cases, doesn't
Expand Down
10 changes: 5 additions & 5 deletions hints/solaris_2.sh
Expand Up @@ -365,18 +365,18 @@ EOM
d_attribute_unused='undef'
d_attribute_warn_unused_result='undef'
case "$cc" in
*c99) # c99 rejects bare '-O'.
case "$optimize" in
''|-O) optimize=-O3 ;;
esac
# Without -Xa c99 doesn't see
*c99) # Without -Xa c99 doesn't see
# many OS interfaces.
case "$ccflags" in
*-Xa*) ;;
*) ccflags="$ccflags -Xa" ;;
esac
;;
esac
# GH #21535 - apparent optimization bug in workshop cc
case "$optimize" in
''|-O) optimize=-O1 ;;
esac
;;
esac
fi
Expand Down

0 comments on commit f4ed4ee

Please sign in to comment.