From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 76F883830B2E for ; Thu, 24 Nov 2022 16:27:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 76F883830B2E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AOFvxF3002311 for ; Thu, 24 Nov 2022 16:27:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : subject : message-id : content-type : mime-version; s=pp1; bh=3EQB9qy0c63SQku+M6uzQwz41FeR5AlJbonyIVn1Rx0=; b=cK68VkeuzXUKZkfT4hmz0vYa9MOsniVTT6USuaL13YufNownhhtC5WKJdFrLJQLYl7M4 7n5ilsEipEz7OTQx67sTbGZ7JPZ8f+fchQGYALb+Y9sS6ghMdm22M6tSTX1m29CLHtmz OhikyKAJnsRCos7nmodhWfCABsHA+t/RyZc/IkNrDsrKs/WATUmbs2ef14XUcMhHYday FsHx7d+YjuFq18yBFWr+MO7Ym95eXCBV7pf2tRhHs27Gpyw95heurJ2SI/7yN0MmhJ2z 2jzWk6LeqbK4kx5kqtdcrykY4RD/ainXLe7Rj6t0LlAo2Ko94Z5po2UUKt4ZrDxpL363 jQ== Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3m1n2wek8q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 24 Nov 2022 16:27:02 +0000 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2AOGLcN0012111 for ; Thu, 24 Nov 2022 16:26:59 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma02fra.de.ibm.com with ESMTP id 3kxps8x3bf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 24 Nov 2022 16:26:59 +0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2AOGQvdX38928818 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 24 Nov 2022 16:26:57 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 779DA42041 for ; Thu, 24 Nov 2022 16:26:57 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4CFCA4203F for ; Thu, 24 Nov 2022 16:26:57 +0000 (GMT) Received: from li-42a4824c-28a0-11b2-a85c-f55c0d5956ce.ibm.com (unknown [9.179.18.4]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS for ; Thu, 24 Nov 2022 16:26:57 +0000 (GMT) Date: Thu, 24 Nov 2022 17:26:56 +0100 From: Stefan Schulze Frielinghaus To: gcc@gcc.gnu.org Subject: How to debug while using LTO? Message-ID: Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: j_v5-Ib42eST6Nl35eOSAeRiY0zekOOk X-Proofpoint-GUID: j_v5-Ib42eST6Nl35eOSAeRiY0zekOOk X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-24_11,2022-11-24_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 adultscore=0 suspectscore=0 spamscore=0 mlxscore=0 bulkscore=0 phishscore=0 malwarescore=0 mlxlogscore=851 lowpriorityscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211240120 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi everyone, Currently I'm looking into a wrong-code bug and would like to understand a certain optimization done by combine during local transformation. Without LTO I would simply debug cc1 and step through combine. However, with LTO enabled AFAIK I have to debug lto1 instead. In order to get the lto1 command line of interest according to https://gcc.gnu.org/legacy-ml/gcc/2009-11/msg00047.html I have to pass -Wl,-debug to gcc in order to get the command for collect2 to which itself I have to pass -plugin-opt=-debug in order to get the command for lto-wrapper. According to the aforementioned mail I should add option -debug to lto-wrapper, however, it appears to me that option -debug was removed. I gave options -v and -### a chance without luck, i.e., those only print the usual environment variables and afterwards a list of object files like /tmp/ccPEIV35.ltrans0.ltrans.o /tmp/ccNmpKfS.debug.temp.o /tmp/cceiCIFg.debug.temp.o /tmp/ccZ4Qc7E.debug.temp.o ... but no lto1 command. Thus, how do you retrieve the lto1 command? While desperate I retrieved it manually via strace. However, the lto1 command refers to temporary files which have been erased meanwhile. I actually didn't expect that because I added -save-temps to all the intermediate commands which is also reflected in the environment variable COLLECT_GCC_OPTIONS. Thus, how do you keep temporary files? Cheers, Stefan