Skip to content

Commit d61bffc

Browse files
authored
Merge pull request #7841 from tautschnig/features/gcc-13
Switch GCC-12 CI job to GCC 13
2 parents 88e7bfe + 8b95e24 commit d61bffc

File tree

8 files changed

+47
-36
lines changed

8 files changed

+47
-36
lines changed

.github/workflows/pull-request-checks.yaml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ jobs:
391391
run: cd build; ctest . -V -L CORE -j2
392392

393393
# This job takes approximately 26 to 46 minutes
394-
check-ubuntu-22_04-cmake-gcc-12:
394+
check-ubuntu-22_04-cmake-gcc-13:
395395
runs-on: ubuntu-22.04
396396
steps:
397397
- uses: actions/checkout@v3
@@ -404,7 +404,13 @@ jobs:
404404
DEBIAN_FRONTEND: noninteractive
405405
run: |
406406
sudo apt-get update
407-
sudo apt-get install --no-install-recommends -yq cmake ninja-build gcc-12 gdb g++-12 maven flex bison libxml2-utils dpkg-dev ccache doxygen z3
407+
sudo apt-get install --no-install-recommends -yq cmake ninja-build gcc-13 gdb g++-13 maven flex bison libxml2-utils dpkg-dev ccache doxygen z3
408+
# Update symlinks so that any use of gcc (including our regression
409+
# tests) will use GCC 13.
410+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 110 \
411+
--slave /usr/bin/g++ g++ /usr/bin/g++-13 \
412+
--slave /usr/bin/gcov gcov /usr/bin/gcov-13
413+
sudo ln -sf cpp-13 /usr/bin/cpp
408414
- name: Confirm z3 solver is available and log the version installed
409415
run: z3 --version
410416
- name: Download cvc-5 from the releases page and make sure it can be deployed
@@ -417,29 +423,22 @@ jobs:
417423
uses: actions/cache@v3
418424
with:
419425
path: .ccache
420-
key: ${{ runner.os }}-22.04-Release-gcc-12-${{ github.ref }}-${{ github.sha }}-PR
426+
key: ${{ runner.os }}-22.04-Release-gcc-13-${{ github.ref }}-${{ github.sha }}-PR
421427
restore-keys: |
422-
${{ runner.os }}-22.04-Release-gcc-12-${{ github.ref }}
423-
${{ runner.os }}-22.04-Release-gcc-12
428+
${{ runner.os }}-22.04-Release-gcc-13-${{ github.ref }}
429+
${{ runner.os }}-22.04-Release-gcc-13
424430
- name: ccache environment
425431
run: |
426432
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
427433
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
428434
- name: Configure using CMake
429-
run: cmake -S . -Bbuild -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/gcc-12 -DCMAKE_CXX_COMPILER=/usr/bin/g++-12
430-
- name: Check that doc task works
431-
run: ninja -C build doc
435+
run: cmake -S . -Bbuild -G Ninja -DCMAKE_BUILD_TYPE=Release
432436
- name: Zero ccache stats and limit in size
433437
run: ccache -z --max-size=500M
434438
- name: Build with Ninja
435439
run: ninja -C build -j2
436440
- name: Print ccache stats
437441
run: ccache -s
438-
- name: Check if package building works
439-
run: |
440-
cd build
441-
ninja package
442-
ls *.deb
443442
- name: Run tests
444443
run: cd build; ctest . -V -L CORE -j2
445444

src/ansi-c/compiler_headers/clang_builtins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
'v': 'void',
4444
'w': 'wchar_t',
4545
'x': '_Float16',
46-
'y': '_Float16', # would be '__bf16', but we don't support that yet
46+
'y': '__bf16',
4747
'z': '__CPROVER_size_t'
4848
}
4949

src/ansi-c/compiler_headers/gcc_builtin_headers_generic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ long __builtin_expect_with_probability(long, long, double);
4444
void __builtin_clear_padding();
4545
void __builtin_speculation_safe_value();
4646
void* __builtin_speculation_safe_value_ptr(void*, ...);
47+
_Bool __builtin_is_constant_evaluated(void);
4748

4849
void* __builtin_dwarf_cfa();
4950
unsigned __builtin_dwarf_sp_column();

src/ansi-c/scanner.l

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,12 @@ void ansi_c_scanner_init()
530530
return make_identifier();
531531
}
532532

533+
"__bf16" { if(PARSER.ts_18661_3_Floatn_types)
534+
{ loc(); return TOK_GCC_FLOAT16; }
535+
else
536+
return make_identifier();
537+
}
538+
533539
"_Float32" { if(PARSER.ts_18661_3_Floatn_types)
534540
{ loc(); return TOK_GCC_FLOAT32; }
535541
else

src/cpp/parse.cpp

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ class Parser // NOLINT(readability/identifiers)
267267
bool optStorageSpec(cpp_storage_spect &);
268268
bool optCvQualify(typet &);
269269
bool optAlignas(typet &);
270-
bool rAttribute(typet &);
270+
bool rGCCAttribute(typet &);
271271
bool optAttribute(typet &);
272272
bool optIntegralTypeOrClassSpec(typet &);
273273
bool rConstructorDecl(
@@ -852,15 +852,9 @@ bool Parser::rNamespaceSpec(cpp_namespace_spect &namespace_spec)
852852
// inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
853853
// which occurs in glibc. Obviously we need to better than just throw attribs
854854
// away like this in the future.
855-
if(lex.LookAhead(0)==TOK_GCC_ATTRIBUTE)
856-
{
857-
cpp_tokent tk;
858-
lex.get_token(tk);
859-
860-
typet discard;
861-
if(!rAttribute(discard))
862-
return false;
863-
}
855+
typet discard;
856+
if(!optAttribute(discard))
857+
return false;
864858

865859
switch(lex.LookAhead(0))
866860
{
@@ -1418,6 +1412,10 @@ bool Parser::rDeclaration(cpp_declarationt &declaration)
14181412
if(!optCvQualify(cv_q))
14191413
return false;
14201414

1415+
if(member_spec.is_empty())
1416+
if(!optMemberSpec(member_spec))
1417+
return false;
1418+
14211419
// added these two to do "const static volatile int i=1;"
14221420
if(!optStorageSpec(storage_spec))
14231421
return false;
@@ -2073,7 +2071,7 @@ bool Parser::optCvQualify(typet &cv)
20732071
break;
20742072

20752073
case TOK_GCC_ATTRIBUTE:
2076-
if(!rAttribute(cv))
2074+
if(!rGCCAttribute(cv))
20772075
return false;
20782076
break;
20792077

@@ -2162,11 +2160,11 @@ bool Parser::optAlignas(typet &cv)
21622160
return false;
21632161
}
21642162

2165-
bool Parser::rAttribute(typet &t)
2163+
bool Parser::rGCCAttribute(typet &t)
21662164
{
21672165
#ifdef DEBUG
21682166
indenter _i;
2169-
std::cout << std::string(__indent, ' ') << "Parser::rAttribute "
2167+
std::cout << std::string(__indent, ' ') << "Parser::rGCCAttribute "
21702168
<< lex.LookAhead(0);
21712169
#endif
21722170
cpp_tokent tk;
@@ -2176,7 +2174,7 @@ bool Parser::rAttribute(typet &t)
21762174
{
21772175
case '(':
21782176
if(lex.LookAhead(0)!=')')
2179-
rAttribute(t);
2177+
rGCCAttribute(t);
21802178

21812179
if(lex.LookAhead(0)!=')')
21822180
return false;
@@ -2360,11 +2358,19 @@ bool Parser::rAttribute(typet &t)
23602358
if(lex.LookAhead(0)==')')
23612359
return true;
23622360

2363-
return rAttribute(t);
2361+
return rGCCAttribute(t);
23642362
}
23652363

23662364
bool Parser::optAttribute(typet &t)
23672365
{
2366+
if(lex.LookAhead(0) == TOK_GCC_ATTRIBUTE)
2367+
{
2368+
lex.get_token();
2369+
2370+
if(!rGCCAttribute(t))
2371+
return false;
2372+
}
2373+
23682374
if(lex.LookAhead(0)!='[' ||
23692375
lex.LookAhead(1)!='[')
23702376
return true;
@@ -4487,13 +4493,8 @@ bool Parser::rClassSpec(typet &spec)
44874493
if(!optAlignas(spec))
44884494
return false;
44894495

4490-
if(lex.LookAhead(0)==TOK_GCC_ATTRIBUTE)
4491-
{
4492-
lex.get_token(tk);
4493-
4494-
if(!rAttribute(spec))
4495-
return false;
4496-
}
4496+
if(!optAttribute(spec))
4497+
return false;
44974498

44984499
irept name;
44994500

src/goto-cc/ms_cl_cmdline.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Date: June 2006
1919
class ms_cl_cmdlinet:public goto_cc_cmdlinet
2020
{
2121
public:
22+
using cmdlinet::parse;
2223
virtual bool parse(int, const char **);
2324

2425
ms_cl_cmdlinet()

src/goto-cc/ms_link_cmdline.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Date: July 2018
1919
class ms_link_cmdlinet : public goto_cc_cmdlinet
2020
{
2121
public:
22+
using cmdlinet::parse;
2223
virtual bool parse(int, const char **);
2324

2425
ms_link_cmdlinet()

src/goto-programs/elf_reader.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ Module: Read ELF
1010
/// Read ELF
1111

1212
#include "elf_reader.h"
13+
1314
#include <util/exception_utils.h>
1415

16+
#include <cstdint>
1517
#include <istream>
1618

1719
static void u16_to_native_endian_inplace(bool le_input, uint16_t &input)

0 commit comments

Comments
 (0)