From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 285BD382DA40; Thu, 1 Sep 2022 09:08:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 285BD382DA40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662023302; bh=38XCqiwv9qEQTYdHqCUvUTGharUPn47eFZ+a4vOKyec=; h=From:To:Subject:Date:In-Reply-To:References:From; b=f8pU0Nnq0ntfze+Okox0Dn3YnN7gtbzOkUB1+xoNF6R+Dlbv/oX0arwXc1G4Z2fRr YAQefNnWB9g1HShzGycB5ZRvetx4rsvOHU76qArDNWLdSbK3MJfb2Lvvw0yLk4nagv RB02g+k4+gNDKSVcf/R5EMmJciP7KwhYQ/P/BwpA= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug other/106782] dump_printf_loc has incorrect format attribute Date: Thu, 01 Sep 2022 09:08:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: other X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: internal-improvement X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106782 --- Comment #5 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:953e08fde44a596e4ec2491efd15cd645e1ddc48 commit r13-2336-g953e08fde44a596e4ec2491efd15cd645e1ddc48 Author: Jakub Jelinek Date: Thu Sep 1 11:07:44 2022 +0200 Fix up dump_printf_loc format attribute and adjust uses [PR106782] As discussed on IRC, the r13-2299-g68c61c2daa1f bug only got missed because dump_printf_loc had incorrect format attribute and therefore almost no -Wformat=3D* checking was performed on it. 3, 0 are suitable for function with (whatever, whatever, const char *, va_list) arguments, not for (whatever, whatever, const char *, ...), that one sh= ould use 3, 4. The following patch fixes that and adjusts all spots to fix warnings. In many cases it is just through an ugly cast (for %G casts to gimple * from gassign */gphi * and the like and for %p casts to void * from slp_= node etc.). There are 3 spots where the mismatch was worse though, two using %u or = %d for unsigned HOST_WIDE_INT argument and one %T for enum argument (promo= ted to int). 2022-09-01 Jakub Jelinek PR other/106782 * dumpfile.h (dump_printf_loc): Use ATTRIBUTE_GCC_DUMP_PRINTF (= 3, 4) instead of ATTRIBUTE_GCC_DUMP_PRINTF (3, 0). * tree-parloops.cc (parloops_is_slp_reduction): Cast pointers to derived types of gimple to gimple * to avoid -Wformat warnings. * tree-vect-loop-manip.cc (vect_set_loop_condition, vect_update_ivs_after_vectorizer): Likewise. * tree-vect-stmts.cc (vectorizable_load): Likewise. * tree-vect-patterns.cc (vect_split_statement, vect_recog_mulhs_pattern, vect_recog_average_pattern, vect_determine_precisions_from_range, vect_determine_precisions_from_users): Likewise. * gimple-loop-versioning.cc (loop_versioning::analyze_term_using_scevs): Likewise. * tree-vect-slp.cc (vect_build_slp_tree_1): Likewise. (vect_build_slp_tree): Cast slp_tree to void * to avoid -Wformat warnings. (optimize_load_redistribution_1, vect_match_slp_patterns, vect_build_slp_instance, vect_optimize_slp_pass::materialize, vect_optimize_slp_pass::dump, vect_slp_convert_to_external, vect_slp_analyze_node_operations, vect_bb_partition_graph): Likewise. (vect_print_slp_tree): Likewise. Also use HOST_WIDE_INT_PRINT_UNSIGNED instead of %u. * tree-vect-loop.cc (vect_determine_vectorization_factor, vect_analyze_scalar_cycles_1, vect_analyze_loop_operations, vectorizable_induction, vect_transform_loop): Cast pointers to derived types of gimple to gimple * to avoid -Wformat warnings. (vect_analyze_loop_2): Cast slp_tree to void * to avoid -Wformat warnings. (vect_estimate_min_profitable_iters): Use HOST_WIDE_INT_PRINT_UNSIGNED instead of %d. * tree-vect-slp-patterns.cc (vect_pattern_validate_optab): Use = %G instead of %T and STMT_VINFO_STMT (SLP_TREE_REPRESENTATIVE (nod= e)) instead of SLP_TREE_DEF_TYPE (node).=