2017-11-06 Martin Liska <mliska@suse.cz>
* c-c++-common/dfp/call-by-value.c (foo32): Return a default
value of change return type to void.
(foo64): Likewise.
(foo128): Likewise.
* g++.dg/bprob/g++-bprob-1.C: Likewise.
* g++.dg/cpp0x/lambda/lambda-template.C (f): Likewise.
* g++.dg/cpp0x/range-for6.C (foo): Likewise.
* g++.dg/cpp0x/udlit-template.C: Likewise.
* g++.dg/cpp1z/eval-order3.C (struct A): Likewise.
(operator>>): Likewise.
* g++.dg/expr/cond12.C (struct X): Likewise.
(X::operator=): Likewise.
* g++.dg/gcov/gcov-1.C: Likewise.
* g++.dg/gcov/gcov-threads-1.C (ContentionNoDeadlock_thread): Likewise.
* g++.dg/ipa/devirt-21.C: Likewise.
* g++.dg/ipa/devirt-23.C: Likewise.
* g++.dg/ipa/devirt-34.C (t): Likewise.
* g++.dg/missing-return.C: New test. Likewise.
* g++.dg/opt/
20050511-1.C (bar): Likewise.
* g++.dg/opt/const3.C (A::foo1): Likewise.
(A::foo2): Likewise.
* g++.dg/opt/pr23299.C (E::c): Likewise.
* g++.dg/other/copy2.C (A::operator=): Likewise.
* g++.dg/overload/addr1.C: Likewise.
* g++.dg/pr48484.C: Likewise.
* g++.dg/tls/thread_local3.C (thread_main): Likewise.
* g++.dg/tls/thread_local3g.C (thread_main): Likewise.
* g++.dg/tls/thread_local5.C (thread_main): Likewise.
* g++.dg/tls/thread_local5g.C (thread_main): Likewise.
* g++.dg/tls/thread_local6.C (thread_main): Likewise.
* g++.dg/tls/thread_local6g.C (thread_main): Likewise.
* g++.dg/torture/pr34850.C (OctetString::operator^=): Likewise.
* g++.dg/tree-prof/pr79259.C (fn2): Likewise.
* g++.dg/tree-ssa/pr33604.C (struct Value): Likewise.
* g++.dg/tree-ssa/pr81408.C (struct p): Likewise.
(av): Likewise.
* g++.dg/warn/string1.C (test): Likewise.
From-SVN: r254438
+2017-11-06 Martin Liska <mliska@suse.cz>
+
+ * c-c++-common/dfp/call-by-value.c (foo32): Return a default
+ value of change return type to void.
+ (foo64): Likewise.
+ (foo128): Likewise.
+ * g++.dg/bprob/g++-bprob-1.C: Likewise.
+ * g++.dg/cpp0x/lambda/lambda-template.C (f): Likewise.
+ * g++.dg/cpp0x/range-for6.C (foo): Likewise.
+ * g++.dg/cpp0x/udlit-template.C: Likewise.
+ * g++.dg/cpp1z/eval-order3.C (struct A): Likewise.
+ (operator>>): Likewise.
+ * g++.dg/expr/cond12.C (struct X): Likewise.
+ (X::operator=): Likewise.
+ * g++.dg/gcov/gcov-1.C: Likewise.
+ * g++.dg/gcov/gcov-threads-1.C (ContentionNoDeadlock_thread): Likewise.
+ * g++.dg/ipa/devirt-21.C: Likewise.
+ * g++.dg/ipa/devirt-23.C: Likewise.
+ * g++.dg/ipa/devirt-34.C (t): Likewise.
+ * g++.dg/missing-return.C: New test. Likewise.
+ * g++.dg/opt/20050511-1.C (bar): Likewise.
+ * g++.dg/opt/const3.C (A::foo1): Likewise.
+ (A::foo2): Likewise.
+ * g++.dg/opt/pr23299.C (E::c): Likewise.
+ * g++.dg/other/copy2.C (A::operator=): Likewise.
+ * g++.dg/overload/addr1.C: Likewise.
+ * g++.dg/pr48484.C: Likewise.
+ * g++.dg/tls/thread_local3.C (thread_main): Likewise.
+ * g++.dg/tls/thread_local3g.C (thread_main): Likewise.
+ * g++.dg/tls/thread_local5.C (thread_main): Likewise.
+ * g++.dg/tls/thread_local5g.C (thread_main): Likewise.
+ * g++.dg/tls/thread_local6.C (thread_main): Likewise.
+ * g++.dg/tls/thread_local6g.C (thread_main): Likewise.
+ * g++.dg/torture/pr34850.C (OctetString::operator^=): Likewise.
+ * g++.dg/tree-prof/pr79259.C (fn2): Likewise.
+ * g++.dg/tree-ssa/pr33604.C (struct Value): Likewise.
+ * g++.dg/tree-ssa/pr81408.C (struct p): Likewise.
+ (av): Likewise.
+ * g++.dg/warn/string1.C (test): Likewise.
+
2017-11-05 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/82471
#include "dfp-dbg.h"
-int foo32 (_Decimal32 z)
+void foo32 (_Decimal32 z)
{
z = z + 1.0df;
}
-int foo64 (_Decimal64 z)
+void foo64 (_Decimal64 z)
{
z = z + 1.0dd;
}
-int foo128 (_Decimal128 z)
+void foo128 (_Decimal128 z)
{
z = z + 1.0dl;
}
return for_temp; /* count(6) */
}
-int
+void
call_for ()
{
for_val1 += test_for1 (0);
}
template <class T>
-T f(T t)
+void f(T t)
{
T t2 = t;
if (t != [=]()->T { return t; }())
sum += x;
if (sum != T(10))
abort();
+
+ return sum;
}
int main()
operator"" _abc<'6','6','6'>()
{ return 21; }
-int
+void
test1()
{
int i = operator"" _abc<'1','2','3'>();
int _i;
A(int i): _i(f(i)) { }
A& memfn(int i, int j) { f(j); return *this; }
- int operator<<(int i) { }
+ int operator<<(int i) { return 0; }
A& operator=(const A&) { return *this; }
A& operator+=(int i) { return *this; }
};
B(int i): _i(f(i)) { }
};
-int operator>>(A&, int i) { }
+int operator>>(A&, int i) { return 0; }
A a(0);
A* afn(int i)
// { dg-do run }
struct X {
- X& operator=(const X&){}
+ X& operator=(const X&);
X& operator=(X&){__builtin_abort();}
};
+X g;
+X& X::operator=(const X&)
+{
+ return g;
+}
+
int main(int argv,char**) {
X a, b;
((argv > 2) ? a : b) = X();
return for_temp; /* count(6) */
}
-int
+void
call_for ()
{
for_val1 += test_for1 (0);
for (int32_t i = NR - 1; i >= starti; --i)
pthread_mutex_unlock (&cndMs[i]);
}
+
+ return 0;
}
int main(int argc, char **argv) {
for (unsigned i = 0; i < NR; i++)
protected:
A readerTermDocs;
A subReaders;
- virtual B *m_fn1(int *) {}
+ virtual B *m_fn1(int *) { return NULL; }
virtual inline ~MultiTermDocs();
void wrap(void)
{
protected:
A readerTermDocs;
A subReaders;
- virtual B *m_fn1(int *) {}
+ virtual B *m_fn1(int *) { return NULL; }
virtual inline ~MultiTermDocs();
inline void wrap(void)
{
{
struct A *a=b;
a->t();
+
+ return 0;
}
/* We should guess that the pointer of type B probably points to an instance
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-Wreturn-type -fdump-tree-optimized" } */
+
+int foo(int a)
+{
+} /* { dg-warning "no return statement" } */
+
+/* { dg-final { scan-tree-dump "__builtin_unreachable" "optimized" } } */
if (a.xy[0] != ((SINT16) 0xffff << 2))
abort ();
+
+ return 0;
}
int main()
int i;
-int A::foo1(void *ios, const char *str) { }
-int A::foo2(int v, const Type t) { i=0; }
+int A::foo1(void *ios, const char *str) { return 0; }
+int A::foo2(int v, const Type t) { i=0; return 0; }
int main()
{
if (x > 10)
throw 1;
x |= 2;
+
+ return x;
}
int
{
public:
int i;
- A &operator =(const A &i)
- {
+ A &operator =(const A &i);
+};
+
+A a;
+
+A& A::operator=(const A &i) {
status = 0;
+ return a;
}
-};
class B
{
template <typename> struct A
{
- A &active () { flag++;}
+ A &active () { flag++; static A a; return a; }
static void foo() {}
jump = 0;
}
}
+
+ return false;
}
bool
}
}
+ return true;
}
void *thread_main(void *)
{
f(); f(); f();
+ return 0;
}
#include <pthread.h>
void *thread_main(void *)
{
A* ap = &a;
+ return 0;
}
#include <pthread.h>
void *thread_main(void *)
{
f(); f(); f();
+ return 0;
}
int main()
void *thread_main(void *)
{
A* ap = &a;
+ return 0;
}
int main()
void *thread_main(void *)
{
f(); f(); f();
+ return 0;
}
int main()
void *thread_main(void *)
{
A* ap = &a;
+ return 0;
}
int main()
void * memset (void *__dest, int __ch, size_t __len) throw () {
if (__builtin_constant_p (__len) && __len == 0)
__warn_memset_zero_len (); /* { dg-warning "declared with attribute warning" } */
+
+ return __dest;
}
}
inline void clear_mem(void* ptr, u32bit n) {
public:
SecureVector<T>& operator=(const MemoryRegion<T>& in) {
if(this != &in) this->set(in);
+ return *this;
}
};
class OctetString {
public:
SecureVector<byte> bits_of() const {
+ return SecureVector<byte> ();
}
OctetString& operator^=(const OctetString&);
void change(const MemoryRegion<byte>& in) {
if(&k == this) {
bits.clear();
}
+
+ return *this;
}
bool __attribute__((flatten))
operator==(const OctetString& s1, const OctetString& s2) {
{
if (a (c == 0))
return 0;
+
+ return 0;
}
int main()
double value;
Value(double value_) : value (value_) {}
operator double() const { return value; }
- Value& operator=(double other) { value = other; }
+ Value& operator=(double other) { value = other; return *this; }
};
struct Ref
/* { dg-do compile } */
/* { dg-options "-O2 -std=gnu++11 -fopt-info-loop-missed -Wunsafe-loop-optimizations" } */
+struct p
+{
+ char *ay;
+};
namespace a {
void b () __attribute__ ((__noreturn__));
j l;
public:
- typename d<j>::f operator* () {}
+ typename d<j>::f operator* () { return p(); }
void operator++ () { ++l; }
j
aa ()
{
return o.aa () != p2.aa ();
}
-struct p;
namespace a {
struct F
{
av (au o)
{
o.aq ('\n');
+ return at();
}
u ax;
}
-struct p
-{
- char *ay;
-};
a::H t;
void
ShowHelpListCommands ()
//
std::string s = "";
s += 'x' + "y"; // { dg-warning "bounds of constant string" }
+
+ return 0;
}