cave in and initialize variables in gcc
This commit is contained in:
parent
6ca5050f4d
commit
af978bbc91
@ -1,6 +1,3 @@
|
|||||||
#if defined(__GNUC__) && !defined(__clang__) // have to do this at the very top because diagnostic ignoring works based on the callee location, not caller
|
|
||||||
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
|
||||||
#endif
|
|
||||||
#include "../core.h"
|
#include "../core.h"
|
||||||
#include "../utils/each.h"
|
#include "../utils/each.h"
|
||||||
#include "../utils/file.h"
|
#include "../utils/file.h"
|
||||||
@ -150,12 +147,13 @@ static B m1c2(B t, B f, B w, B x) { // consumes w,x
|
|||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
#pragma GCC diagnostic ignored "-Wsometimes-uninitialized"
|
#pragma GCC diagnostic ignored "-Wsometimes-uninitialized"
|
||||||
|
// no gcc case because there's no way to do it specifically for this segment of code; X##_csh is just initialized with an unused null pointer
|
||||||
#endif
|
#endif
|
||||||
#define S_SLICES(X) \
|
#define S_SLICES(X) \
|
||||||
BSS2A X##_slc = TI(X,slice); \
|
BSS2A X##_slc = TI(X,slice); \
|
||||||
usz X##_csz = 1; \
|
usz X##_csz = 1; \
|
||||||
usz X##_cr = RNK(X)-1; \
|
usz X##_cr = RNK(X)-1; \
|
||||||
ShArr* X##_csh; \
|
ShArr* X##_csh ONLY_GCC(=0); \
|
||||||
if (X##_cr>1) { \
|
if (X##_cr>1) { \
|
||||||
X##_csh = m_shArr(X##_cr); \
|
X##_csh = m_shArr(X##_cr); \
|
||||||
PLAINLOOP for (usz i = 0; i < X##_cr; i++) { \
|
PLAINLOOP for (usz i = 0; i < X##_cr; i++) { \
|
||||||
|
|||||||
@ -316,7 +316,7 @@ B rank_c1(Md2D* d, B x) { B f = d->f; B g = d->g;
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
usz csz = shProd(xsh, k, xr);
|
usz csz = shProd(xsh, k, xr);
|
||||||
ShArr* csh;
|
ShArr* csh ONLY_GCC(= NULL);
|
||||||
if (cr>1) {
|
if (cr>1) {
|
||||||
csh = m_shArr(cr);
|
csh = m_shArr(cr);
|
||||||
shcpy(csh->a, xsh+k, cr);
|
shcpy(csh->a, xsh+k, cr);
|
||||||
|
|||||||
@ -139,7 +139,7 @@ B shape_c2(B t, B w, B x) {
|
|||||||
} else {
|
} else {
|
||||||
SGetU(w)
|
SGetU(w)
|
||||||
i32 unkPos = -1;
|
i32 unkPos = -1;
|
||||||
i32 unkInd;
|
i32 unkInd ONLY_GCC(= 0);
|
||||||
bool bad=false, good=false;
|
bool bad=false, good=false;
|
||||||
for (i32 i = 0; i < nr; i++) {
|
for (i32 i = 0; i < nr; i++) {
|
||||||
B c = GetU(w, i);
|
B c = GetU(w, i);
|
||||||
|
|||||||
@ -268,6 +268,7 @@ static B compress_grouped(u64* wp, B x, usz wia, usz wsum, u8 xt) {
|
|||||||
xp = tyany_ptr(x);
|
xp = tyany_ptr(x);
|
||||||
rp = m_tyarrv(&r,width,wsum,xt);
|
rp = m_tyarrv(&r,width,wsum,xt);
|
||||||
} else {
|
} else {
|
||||||
|
ONLY_GCC(r = m_f64(0);)
|
||||||
xp = (u8*)arr_bptr(x);
|
xp = (u8*)arr_bptr(x);
|
||||||
usz ria = wsum*csz;
|
usz ria = wsum*csz;
|
||||||
if (xp != NULL) {
|
if (xp != NULL) {
|
||||||
@ -709,7 +710,7 @@ B slash_c1(B t, B x) {
|
|||||||
|
|
||||||
B slash_c2(B t, B w, B x) {
|
B slash_c2(B t, B w, B x) {
|
||||||
i32 wv = -1;
|
i32 wv = -1;
|
||||||
usz wia;
|
usz wia ONLY_GCC(= 0);
|
||||||
if (isArr(w)) {
|
if (isArr(w)) {
|
||||||
if (depth(w)>1) goto base;
|
if (depth(w)>1) goto base;
|
||||||
ur wr = RNK(w);
|
ur wr = RNK(w);
|
||||||
|
|||||||
5
src/h.h
5
src/h.h
@ -152,6 +152,11 @@ typedef double f64;
|
|||||||
#define NOVECTORIZE
|
#define NOVECTORIZE
|
||||||
#endif
|
#endif
|
||||||
#define PLAINLOOP NOUNROLL NOVECTORIZE
|
#define PLAINLOOP NOUNROLL NOVECTORIZE
|
||||||
|
#if EXACTLY_GCC
|
||||||
|
#define ONLY_GCC(X) X
|
||||||
|
#else
|
||||||
|
#define ONLY_GCC(X)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define JOIN0(A,B) A##B
|
#define JOIN0(A,B) A##B
|
||||||
#define JOIN(A,B) JOIN0(A,B)
|
#define JOIN(A,B) JOIN0(A,B)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user