+2020-01-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR ipa/93087
+ * predict.c (compute_function_frequency): Don't call
+ warn_function_cold on functions that already have cold attribute.
+
2020-01-01 John David Anglin <danglin@gcc.gnu.org>
PR target/67834
int flags = flags_from_decl_or_type (current_function_decl);
if (lookup_attribute ("cold", DECL_ATTRIBUTES (current_function_decl))
!= NULL)
- {
- node->frequency = NODE_FREQUENCY_UNLIKELY_EXECUTED;
- warn_function_cold (current_function_decl);
- }
+ node->frequency = NODE_FREQUENCY_UNLIKELY_EXECUTED;
else if (lookup_attribute ("hot", DECL_ATTRIBUTES (current_function_decl))
!= NULL)
node->frequency = NODE_FREQUENCY_HOT;
+2020-01-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR ipa/93087
+ * c-c++-common/cold-1.c: New test.
+
2020-01-01 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/90374
--- /dev/null
+/* PR ipa/93087 */
+/* { dg-do compile { target nonpic } } */
+/* { dg-options "-O1 -Wsuggest-attribute=cold" } */
+
+extern void *getdata (void);
+extern int set_error (char const *message) __attribute__((cold));
+
+__attribute__((cold)) int
+set_nomem (void) /* { dg-bogus "function might be candidate for attribute 'cold'" } */
+{
+ return set_error ("Allocation failed");
+}
+
+void *
+getdata_or_set_error (void)
+{
+ void *result;
+ result = getdata ();
+ if (!result)
+ set_nomem ();
+ return result;
+}